Пример #1
0
 @Override
 public String[] listAll() throws IOException {
   final Transaction txn = env.getAndCheckCurrentTransaction();
   final ArrayList<String> allFiles = new ArrayList<>((int) vfs.getNumberOfFiles(txn));
   for (final File file : vfs.getFiles(txn)) {
     allFiles.add(file.getPath());
   }
   return allFiles.toArray(new String[allFiles.size()]);
 }
Пример #2
0
 File openExistingFile(@NotNull final String name, final boolean throwFileNotFound) {
   final File result = vfs.openFile(env.getAndCheckCurrentTransaction(), name, false);
   if (throwFileNotFound && result == null) {
     throw new FileNotFoundException(name);
   }
   return result;
 }
Пример #3
0
 @Override
 public long fileLength(String name) throws IOException {
   return vfs.getFileLength(env.getAndCheckCurrentTransaction(), openExistingFile(name, true));
 }
Пример #4
0
 @Override
 public void deleteFile(String name) throws IOException {
   vfs.deleteFile(env.getAndCheckCurrentTransaction(), name);
 }
Пример #5
0
 @Override
 public void touchFile(String name) throws IOException {
   vfs.touchFile(env.getAndCheckCurrentTransaction(), openExistingFile(name, true));
 }
Пример #6
0
 @Override
 public void close() throws IOException {
   vfs.shutdown();
 }