Yeah that's a better way, for some reason I thought isComplete had
something to do with checkpointing... need to review the code again
sometime!


On Mon, Jul 15, 2013 at 9:45 PM, Haoyuan Li <notifications@github.com>wrote:

> In src/main/java/tachyon/web/WebInterfaceBrowseServlet.java:
>
> >      if (tFile == null) {
> >        throw new FileDoesNotExistException(path);
> >      }
> >
> >      InStream is = tFile.getInStream(ReadType.NO_CACHE);
> >      int len = Math.min(5 * Constants.KB, (int) tFile.length());
> > -    byte[] data = new byte[len];
> > -    is.read(data, 0, len);
> > -    String fileData = CommonUtils.convertByteArrayToString(data);
> > -    if (fileData == null) {
> > -      fileData = "The requested file is not completely encoded in ascii";
> > +    if (len > 0) {
>
> There is a API called isComplete() in
> https://github.com/amplab/tachyon/blob/master/src/main/java/tachyon/client/TachyonFile.java
>
> Try to use that. If the file is complete and the length is 0, should just
> show nothing as content. Or if not complete, show "File XXX is not complete
> yet."
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/amplab/tachyon/pull/32/files#r5208436>
> .
>