X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Flocal%2FDataFile.java;h=a65c13db20c2bf094af87243346900c522df6035;hb=7e966914050e66219689001ff4ab601a49eef0ac;hp=7e420df490564e9746710a767f43de265789e0fb;hpb=ead32f193586e39b59bb366bddf70e665173a52d;p=aaf%2Fauthz.git diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/DataFile.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/DataFile.java index 7e420df4..a65c13db 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/DataFile.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/DataFile.java @@ -43,7 +43,7 @@ public class DataFile { this.access = access; } public void open() throws IOException { - if(!file.exists()) throw new FileNotFoundException(); + if (!file.exists()) throw new FileNotFoundException(); rafile = new RandomAccessFile(file,access); channel = rafile.getChannel(); mapBuff = channel.map("r".equals(access)?MapMode.READ_ONLY:MapMode.READ_WRITE,0,channel.size()); @@ -52,10 +52,10 @@ public class DataFile { return mapBuff!=null; } public void close() throws IOException { - if(channel!=null){ + if (channel!=null){ channel.close(); } - if(rafile!=null) { + if (rafile!=null) { rafile.close(); } mapBuff = null; @@ -67,7 +67,7 @@ public class DataFile { private synchronized int load(Token t) { int len = Math.min(mapBuff.limit()-t.next,t.buff.length); - if(len>0) { + if (len>0) { mapBuff.position(t.next); mapBuff.get(t.buff,0,len); } @@ -91,8 +91,8 @@ public class DataFile { public boolean nextLine() { end = load(this); pos = next; - for(int i=0;i=end)return null; + if (idx>=end)return null; int start = idx; byte c=0; int endStr = -1; - while(idx=end)?1:0)));