@Override public String getDatabasePath() { if (persistent) { return FileUtils.toRealPath(databaseName); } return null; }
private static String getFileNamePrefix(String path, int objectId) { String name; int f = objectId % SysProperties.LOB_FILES_PER_DIRECTORY; if (f > 0) { name = SysProperties.FILE_SEPARATOR + objectId; } else { name = ""; } objectId /= SysProperties.LOB_FILES_PER_DIRECTORY; while (objectId > 0) { f = objectId % SysProperties.LOB_FILES_PER_DIRECTORY; name = SysProperties.FILE_SEPARATOR + f + Constants.SUFFIX_LOBS_DIRECTORY + name; objectId /= SysProperties.LOB_FILES_PER_DIRECTORY; } name = FileUtils.toRealPath(path + Constants.SUFFIX_LOBS_DIRECTORY + name); return name; }
/** * Normalize the directory name. * * @param dir the directory (null for the current directory) * @return the normalized directory name */ public static String getDir(String dir) { if (dir == null || dir.equals("")) { return "."; } return FileUtils.toRealPath(dir); }
private static void backupFile(ZipOutputStream out, String base, String fn, InputStream in) throws IOException { String f = FileUtils.toRealPath(fn); base = FileUtils.toRealPath(base); if (!f.startsWith(base)) { DbException.throwInternalError(f + " does not start with " + base); } f = f.substring(base.length()); f = correctFileName(f); out.putNextEntry(new ZipEntry(f)); IOUtils.copyAndCloseInput(in, out); out.closeEntry(); }
ArrayList<String> files = New.arrayList(); String start = db == null ? null : (FileUtils.toRealPath(dir + "/" + db) + "."); for (String f : FileUtils.newDirectoryStream(dir)) { boolean ok = false;
String absDir = FileUtils.unwrap(FileUtils.toRealPath(dir)); boolean absolute = FileUtils.isAbsolute(name); String n; n = dir + SysProperties.FILE_SEPARATOR + n; String normalizedName = FileUtils.unwrap(FileUtils.toRealPath(n)); if (normalizedName.equals(absDir) || !normalizedName.startsWith(absDir)) {
String n; if (FileUtils.exists(name + suffix)) { n = FileUtils.toRealPath(name + suffix); } else { suffix = Constants.SUFFIX_MV_FILE; n = FileUtils.toRealPath(name + suffix);
String absolutePath = FileUtils.toRealPath(fileName); System.setProperty(KEYSTORE_KEY, absolutePath);
FileLister.tryUnlockDatabase(list, "backup"); zipFileName = FileUtils.toRealPath(zipFileName); FileUtils.delete(zipFileName); OutputStream fileOut = null; String f = FileUtils.toRealPath(fileName); if (!f.startsWith(base)) { DbException.throwInternalError(f + " does not start with " + base);
@Override public String getDatabasePath() { if (persistent) { return FileUtils.toRealPath(databaseName); } return null; }
@Override public String getDatabasePath() { if (persistent) { return FileUtils.toRealPath(databaseName); } return null; }
private static String getFileNamePrefix(String path, int objectId) { String name; int f = objectId % SysProperties.LOB_FILES_PER_DIRECTORY; if (f > 0) { name = SysProperties.FILE_SEPARATOR + objectId; } else { name = ""; } objectId /= SysProperties.LOB_FILES_PER_DIRECTORY; while (objectId > 0) { f = objectId % SysProperties.LOB_FILES_PER_DIRECTORY; name = SysProperties.FILE_SEPARATOR + f + Constants.SUFFIX_LOBS_DIRECTORY + name; objectId /= SysProperties.LOB_FILES_PER_DIRECTORY; } name = FileUtils.toRealPath(path + Constants.SUFFIX_LOBS_DIRECTORY + name); return name; }
private static String getFileNamePrefix(String path, int objectId) { String name; int f = objectId % SysProperties.LOB_FILES_PER_DIRECTORY; if (f > 0) { name = SysProperties.FILE_SEPARATOR + objectId; } else { name = ""; } objectId /= SysProperties.LOB_FILES_PER_DIRECTORY; while (objectId > 0) { f = objectId % SysProperties.LOB_FILES_PER_DIRECTORY; name = SysProperties.FILE_SEPARATOR + f + Constants.SUFFIX_LOBS_DIRECTORY + name; objectId /= SysProperties.LOB_FILES_PER_DIRECTORY; } name = FileUtils.toRealPath(path + Constants.SUFFIX_LOBS_DIRECTORY + name); return name; }
/** * Normalize the directory name. * * @param dir the directory (null for the current directory) * @return the normalized directory name */ public static String getDir(String dir) { if (dir == null || dir.equals("")) { return "."; } return FileUtils.toRealPath(dir); }
/** * Normalize the directory name. * * @param dir the directory (null for the current directory) * @return the normalized directory name */ public static String getDir(String dir) { if (dir == null || dir.equals("")) { return "."; } return FileUtils.toRealPath(dir); }
private static void backupFile(ZipOutputStream out, String base, String fn, InputStream in) throws IOException { String f = FileUtils.toRealPath(fn); base = FileUtils.toRealPath(base); if (!f.startsWith(base)) { DbException.throwInternalError(f + " does not start with " + base); } f = f.substring(base.length()); f = correctFileName(f); out.putNextEntry(new ZipEntry(f)); IOUtils.copyAndCloseInput(in, out); out.closeEntry(); }
private static void backupFile(ZipOutputStream out, String base, String fn, InputStream in) throws IOException { String f = FileUtils.toRealPath(fn); base = FileUtils.toRealPath(base); if (!f.startsWith(base)) { DbException.throwInternalError(f + " does not start with " + base); } f = f.substring(base.length()); f = correctFileName(f); out.putNextEntry(new ZipEntry(f)); IOUtils.copyAndCloseInput(in, out); out.closeEntry(); }
String n; if (FileUtils.exists(name + suffix)) { n = FileUtils.toRealPath(name + suffix); } else { suffix = Constants.SUFFIX_MV_FILE; n = FileUtils.toRealPath(name + suffix);
String absolutePath = FileUtils.toRealPath(fileName); System.setProperty(KEYSTORE_KEY, absolutePath);
String absolutePath = FileUtils.toRealPath(fileName); System.setProperty(KEYSTORE_KEY, absolutePath);