|
From: <das...@us...> - 2008-10-29 19:25:39
|
Revision: 1177
http://vlab.svn.sourceforge.net/vlab/?rev=1177&view=rev
Author: dasil014
Date: 2008-10-29 19:25:36 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
I added a function getListofFiles(String pathProjectHP) to list all files from the gnuplot plot generation
Modified Paths:
--------------
trunk/vlab/services/project-executor/src/main/java/org/vlab/services/ProjectExecutorManager.java
Modified: trunk/vlab/services/project-executor/src/main/java/org/vlab/services/ProjectExecutorManager.java
===================================================================
--- trunk/vlab/services/project-executor/src/main/java/org/vlab/services/ProjectExecutorManager.java 2008-10-29 19:15:14 UTC (rev 1176)
+++ trunk/vlab/services/project-executor/src/main/java/org/vlab/services/ProjectExecutorManager.java 2008-10-29 19:25:36 UTC (rev 1177)
@@ -28,6 +28,7 @@
private String pathPhononDir;
private String pathProjectHP;
private String ENV_SCRIPT;
+ public int numberoffile;
public ProjectExecutorManager(){
loadProperties();
@@ -40,8 +41,8 @@
Properties proper = new Properties();
try{
- //proper.load( this.getClass().getClassLoader().getResourceAsStream("resource.properties") );
- proper.load(this.getClass().getResourceAsStream("resource.properties"));
+ proper.load( this.getClass().getClassLoader().getResourceAsStream("resource.properties") );
+ //proper.load(this.getClass().getResourceAsStream("resource.properties"));
} catch (Exception ae){
System.err.println("[ProjectExecutor::loadProperties] Error loading resource properties => "+ae.getMessage());
ae.printStackTrace();
@@ -241,6 +242,7 @@
return returnString;
}
+
public void execute(){
System.out.println("\n ");
@@ -296,8 +298,8 @@
Properties proper = new Properties();
try{
- //proper.load( this.getClass().getClassLoader().getResourceAsStream("resource.properties") );
- proper.load(this.getClass().getResourceAsStream("resource.properties"));
+ proper.load( this.getClass().getClassLoader().getResourceAsStream("resource.properties") );
+ //proper.load(this.getClass().getResourceAsStream("resource.properties"));
} catch (Exception ae){
System.err.println("[ProjectExecutor::loadProperties] Error loading resource properties => "+ae.getMessage());
ae.printStackTrace();
@@ -505,7 +507,7 @@
ae.printStackTrace();
}
}
-
+ /*
public void copyToDownload(){
File newDirDownload = null;
@@ -775,6 +777,7 @@
}
setUrlListofFiles("http://dasilveira.msi.umn.edu:8180/axis/openplotout.jsp?PathExec="+pathProjectHP+"/ListOfFiles.txt");
}
+ */
public void createZipFile(){
@@ -791,8 +794,11 @@
try{
FileDir = new File(pathProjectHP);
+ String listofFiles = getListofFiles(pathProjectHP);
- String[] fullcommand = { this.ENV_SCRIPT +"zipFile2.sh", pathProjectHP+"/download/"};
+ System.out.println("List of file to compact: " + listofFiles);
+ System.out.println("WorkDir: "+FileDir);
+ String[] fullcommand = { this.ENV_SCRIPT +"zipFile2.sh", listofFiles};
Runtime Rt = Runtime.getRuntime();
Process procShell = Rt.exec(fullcommand, null , FileDir);
@@ -819,6 +825,35 @@
}
+ private String getListofFiles(String pathProjectHP){
+
+ File listFile = new File(pathProjectHP);
+ String[] ArrayOfFiles = null;
+ FilenameFilter filter = null;
+ String ConcatenateListofFile = "";
+
+ filter = new FilenameFilter(){
+ public boolean accept(File dir, String name){
+ return name.matches(".*.dat");
+ }
+ };
+
+ try{
+ ArrayOfFiles = listFile.list(filter);
+ numberoffile = 0;
+ for (int i=0; i<ArrayOfFiles.length; i++) {
+ // Get filename of file or directory
+ ConcatenateListofFile = ConcatenateListofFile + " " + ArrayOfFiles[i];
+ //System.out.println(ConcatenateListofFile);
+ numberoffile++;
+ }
+ } catch(Exception ae){
+ System.err.println("Error listing the the dat files: "+ae.getMessage());
+ ae.printStackTrace();
+ }
+ return ConcatenateListofFile;
+ }
+
public String getDownloadFile(){
File downloadFile = null;
@@ -827,7 +862,7 @@
String StringReturned = null;
try{
- downloadFile = new File(pathProjectHP + "download.zip");
+ downloadFile = new File(pathProjectHP + "hightempfile.zip");
System.out.println("\n File name is: " + downloadFile.getName());
System.out.println("\n File size is: " + downloadFile.length());
@@ -903,6 +938,4 @@
System.out.println(e.getMessage());
}
}
-
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|