57 File thumbs =
new File(ff.
getFile().getAbsolutePath() +
"/thumbs");
59 if (!thumbs.exists()) {
62 for (File file : ff.
getFile().listFiles(
new FilenameFilter() {
64 public boolean accept(File dir, String name) {
65 return !name.endsWith(
".properties") && name.contains(
".") && name.matches(
".*\\.(jpg|jpeg|png|gif|tif)");
68 for (
int i = 0; i < 20; i++) {
69 String command = props.getProperty(
"cmdimg" + i,
null);
70 if (command !=
null) {
71 String thumbName = file.getName();
72 thumbName = thumbName.substring(0, thumbName.lastIndexOf(
".")) +
".png";
73 new ShellExecutor().execute(command.replaceAll(
"#file", file.getAbsolutePath()).replaceAll(
"#thumb", thumbs.getAbsolutePath() +
"/" + thumbName));
78 for (File file : ff.
getFile().listFiles(
new FilenameFilter() {
80 public boolean accept(File dir, String name) {
81 return !name.endsWith(
".properties") && name.contains(
".") && name.matches(
".*\\.(avi|mpeg|mpg|vob|divx)");
84 for (
int i = 0; i < 20; i++) {
85 String command = props.getProperty(
"cmdvid" + i,
null);
86 if (command !=
null) {
87 String flvName = file.getAbsolutePath();
88 flvName = flvName.substring(0, flvName.lastIndexOf(
".")) +
".flv";
89 new ShellExecutor().execute(command.replaceAll(
"#file", file.getAbsolutePath()).replaceAll(
"#flv", flvName));
94 for (File file : ff.
getFile().listFiles(
new FilenameFilter() {
96 public boolean accept(File dir, String name) {
97 return !name.endsWith(
".properties") && name.contains(
".") && name.matches(
".*\\.(flv)");
100 for (
int i = 0; i < 20; i++) {
101 String command = props.getProperty(
"cmdflv" + i,
null);
102 if (command !=
null) {
103 String thumbName = file.getName();
104 thumbName = thumbName.substring(0, thumbName.lastIndexOf(
".")) +
".png";
105 new ShellExecutor().execute(command.replaceAll(
"#file", file.getAbsolutePath()).replaceAll(
"#thumb", thumbs.getAbsolutePath() +
"/" + thumbName));
109 for (File file : thumbs.listFiles(
new FilenameFilter() {
111 public boolean accept(File dir, String name) {
112 return name.endsWith(
".png");
115 for (
int i = 0; i < 20; i++) {
116 String command = props.getProperty(
"cmdthumb" + i,
null);
117 if (command !=
null) {
118 new ShellExecutor().execute(command.replaceAll(
"#thumb", file.getAbsolutePath()));
123 }
catch (FileNotFoundException ex) {
124 Logger.getLogger(
GalleryAction.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
125 }
catch (IOException ex) {
126 Logger.getLogger(
GalleryAction.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
Properties getProperties()
GalleryAction(FolderFile ff)