private String generateSaveFileString(INexObject media, String id) { String mediaFolder = Settings.MediaFolder().get(); String fileName = id; String ext = ""; String folder = "unknown"; if (media.getClass().getAnnotation(FileDetails.class) != null) { ext = media.getClass().getAnnotation(FileDetails.class).extension(); folder = media.getClass().getAnnotation(FileDetails.class).folder(); } if (!mediaFolder.endsWith(dir_sep)) mediaFolder = mediaFolder.concat(dir_sep); if (folder.startsWith(dir_sep)) folder = folder.substring(1); if (!folder.endsWith(dir_sep)) folder = folder.concat(dir_sep); if (fileName.startsWith(dir_sep)) fileName = fileName.substring(1); if (fileName.endsWith(dir_sep)) fileName = fileName.substring(0, fileName.length() - 2); return (mediaFolder + folder + fileName + ext); }
public String generateSaveFileString(INexObject media) { return generateSaveFileString(media, media.getSaveString()); }