コード例 #1
0
 /** Load implementation for FileCacheKey: must return the metadata of the requested file. */
 private FileMetadata loadIntern(final FileCacheKey key) throws IOException {
   final String fileName = key.getFileName();
   final long fileLength = directory.fileLength(fileName);
   // We're forcing the buffer size of a to-be-read segment to the full file size:
   final int bufferSize = (int) Math.min(fileLength, (long) autoChunkSize);
   final FileMetadata meta = new FileMetadata(bufferSize);
   meta.setSize(fileLength);
   return meta;
 }
コード例 #2
0
 /** ContainsKey implementation for chunk elements */
 protected Boolean containsKeyIntern(final FileCacheKey fileCacheKey) throws IOException {
   return Boolean.valueOf(directory.fileExists(fileCacheKey.getFileName()));
 }