@Override
 public Optional<InputStream> getFileContents(BuildJobStateFileHashEntry entry)
     throws IOException {
   Preconditions.checkState(
       entry.isSetHashCode(), String.format("File hash missing for file [%s]", entry.getPath()));
   return Optional.of(service.fetchSourceFile(entry.getHashCode()));
 }
    @Override
    public Optional<InputStream> getFileContents(BuildJobStateFileHashEntry entry) {
      if (entry.isSetContents()) {
        byte[] contents = entry.getContents();
        return Optional.<InputStream>of(new ByteArrayInputStream(contents));
      }

      return Optional.absent();
    }