private static String translateFileName(String fileName) { if (fileName.startsWith("zip:")) { fileName = fileName.substring("zip:".length()); } int idx = fileName.indexOf('!'); if (idx >= 0) { fileName = fileName.substring(0, idx); } return FilePathDisk.expandUserHomeDirectory(fileName); }
/** * Translate the file name to the native format. This will replace '\' with * '/' and expand the home directory ('~'). * * @param fileName the file name * @return the native file name */ protected static String translateFileName(String fileName) { fileName = fileName.replace('\\', '/'); if (fileName.startsWith("file:")) { fileName = fileName.substring("file:".length()); } return expandUserHomeDirectory(fileName); }