private void deleteOldTempFiles() { String path = FileUtils.getParent(databaseName); for (String name : FileUtils.newDirectoryStream(path)) { if (name.endsWith(Constants.SUFFIX_TEMP_FILE) && name.startsWith(databaseName)) { // can't always delete the files, they may still be open FileUtils.tryDelete(name); } } }
private static String[] getFileList(DataHandler h, String dir) { SmallLRUCache<String, String[]> cache = h.getLobFileListCache(); String[] list; if (cache == null) { list = FileUtils.newDirectoryStream(dir).toArray(new String[0]); } else { synchronized (cache) { list = cache.get(dir); if (list == null) { list = FileUtils.newDirectoryStream(dir).toArray(new String[0]); cache.put(dir, list); } } } return list; }
for (String f : FileUtils.newDirectoryStream(dir)) { boolean ok = false; if (f.endsWith(Constants.SUFFIX_LOBS_DIRECTORY)) {
boolean allFiles = db != null && db.length() == 0; if (allFiles) { list = FileUtils.newDirectoryStream(directory); } else { list = FileLister.getDatabaseFiles(directory, db, true);
/** * Delete a directory or file and all subdirectories and files. * * @param path the path * @param tryOnly whether errors should be ignored */ public static void deleteRecursive(String path, boolean tryOnly) { if (exists(path)) { if (isDirectory(path)) { for (String s : newDirectoryStream(path)) { deleteRecursive(s, tryOnly); } } if (tryOnly) { tryDelete(path); } else { delete(path); } } }
private void deleteOldTempFiles() { String path = FileUtils.getParent(databaseName); for (String name : FileUtils.newDirectoryStream(path)) { if (name.endsWith(Constants.SUFFIX_TEMP_FILE) && name.startsWith(databaseName)) { // can't always delete the files, they may still be open FileUtils.tryDelete(name); } } }
private void deleteOldTempFiles() { String path = FileUtils.getParent(databaseName); for (String name : FileUtils.newDirectoryStream(path)) { if (name.endsWith(Constants.SUFFIX_TEMP_FILE) && name.startsWith(databaseName)) { // can't always delete the files, they may still be open FileUtils.tryDelete(name); } } }
private static String[] getFileList(DataHandler h, String dir) { SmallLRUCache<String, String[]> cache = h.getLobFileListCache(); String[] list; if (cache == null) { list = FileUtils.newDirectoryStream(dir).toArray(new String[0]); } else { synchronized (cache) { list = cache.get(dir); if (list == null) { list = FileUtils.newDirectoryStream(dir).toArray(new String[0]); cache.put(dir, list); } } } return list; }
private static String[] getFileList(DataHandler h, String dir) { SmallLRUCache<String, String[]> cache = h.getLobFileListCache(); String[] list; if (cache == null) { list = FileUtils.newDirectoryStream(dir).toArray(new String[0]); } else { synchronized (cache) { list = cache.get(dir); if (list == null) { list = FileUtils.newDirectoryStream(dir).toArray(new String[0]); cache.put(dir, list); } } } return list; }
for (String f : FileUtils.newDirectoryStream(dir)) { boolean ok = false; if (f.endsWith(Constants.SUFFIX_LOBS_DIRECTORY)) {
for (String f : FileUtils.newDirectoryStream(dir)) { boolean ok = false; if (f.endsWith(Constants.SUFFIX_LOBS_DIRECTORY)) {
boolean allFiles = db != null && db.length() == 0; if (allFiles) { list = FileUtils.newDirectoryStream(directory); } else { list = FileLister.getDatabaseFiles(directory, db, true);
boolean allFiles = db != null && db.length() == 0; if (allFiles) { list = FileUtils.newDirectoryStream(directory); } else { list = FileLister.getDatabaseFiles(directory, db, true);
/** * Delete a directory or file and all subdirectories and files. * * @param path the path * @param tryOnly whether errors should be ignored */ public static void deleteRecursive(String path, boolean tryOnly) { if (exists(path)) { if (isDirectory(path)) { for (String s : newDirectoryStream(path)) { deleteRecursive(s, tryOnly); } } if (tryOnly) { tryDelete(path); } else { delete(path); } } }
/** * Delete a directory or file and all subdirectories and files. * * @param path the path * @param tryOnly whether errors should be ignored */ public static void deleteRecursive(String path, boolean tryOnly) { if (exists(path)) { if (isDirectory(path)) { for (String s : newDirectoryStream(path)) { deleteRecursive(s, tryOnly); } } if (tryOnly) { tryDelete(path); } else { delete(path); } } }