예제 #1
0
 @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()));
 }
예제 #2
0
    @Override
    public Optional<InputStream> getFileContents(BuildJobStateFileHashEntry entry) {
      if (entry.isSetContents()) {
        byte[] contents = entry.getContents();
        return Optional.<InputStream>of(new ByteArrayInputStream(contents));
      }

      return Optional.absent();
    }