Commit adf557d1 by TongZuu

resolve path upload and download

parent 725d39d6
...@@ -7,18 +7,18 @@ ...@@ -7,18 +7,18 @@
<attribute name="owner.project.facets" value="jst.utility"/> <attribute name="owner.project.facets" value="jst.utility"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> <classpathentry kind="lib" path="/Users/csc-mac/Documents/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/CSCFrameWork.jar"/>
<classpathentry kind="lib" path="/Users/csc-mac/Documents/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/dynamicjava.jar"/>
<classpathentry kind="lib" path="/Users/csc-mac/Documents/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/jdom.jar"/>
<classpathentry kind="lib" path="/Users/csc-mac/Documents/EnterprisePT/jar/mail.jar"/>
<classpathentry kind="lib" path="/Users/csc-mac/Documents/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/gson.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/csc-websocket-api"/>
<classpathentry kind="lib" path="/Users/csc-mac/Documents/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/commons-lang-2.3.jar" sourcepath="D:/EnterprisePT/jar/commons/src/commons-lang-2.3-sources.jar"/>
<classpathentry kind="lib" path="/Users/csc-mac/Documents/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/CscServlet.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 8 [1.8.0_91]">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="owner.project.facets" value="java"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="D:/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/CSCFrameWork.jar"/>
<classpathentry kind="lib" path="D:/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/dynamicjava.jar"/>
<classpathentry kind="lib" path="D:/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/jdom.jar"/>
<classpathentry kind="lib" path="D:/EnterprisePT/jar/mail.jar"/>
<classpathentry kind="lib" path="D:/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/gson.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/csc-websocket-api"/>
<classpathentry kind="lib" path="D:/EnterprisePT/jar/commons/commons-lang-2.3.jar" sourcepath="D:/EnterprisePT/jar/commons/src/commons-lang-2.3-sources.jar"/>
<classpathentry kind="lib" path="D:/EnterprisePT/Programmer/myHRAppServer/wildfly-10.0.0.tpbs/standalone/deployments/TPBS.ear/hrAppWeb.war/WEB-INF/lib/CscServlet.jar"/>
<classpathentry kind="output" path=""/> <classpathentry kind="output" path=""/>
</classpath> </classpath>
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6 org.eclipse.jdt.core.compiler.source=1.8
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
<runtime name="WildFly 10.0 Runtime"/> <runtime name="WildFly 10.0 Runtime"/>
<fixed facet="java"/> <fixed facet="java"/>
<fixed facet="jst.utility"/> <fixed facet="jst.utility"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.utility" version="1.0"/> <installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.8"/>
</faceted-project> </faceted-project>
...@@ -7,12 +7,14 @@ import com.csc.library.factory.FileFtpFactory; ...@@ -7,12 +7,14 @@ import com.csc.library.factory.FileFtpFactory;
import com.csc.library.properties.JsonFile; import com.csc.library.properties.JsonFile;
import com.csc.library.properties.JsonFileImpl; import com.csc.library.properties.JsonFileImpl;
import com.csc.library.request.CommandState; import com.csc.library.request.CommandState;
import com.csc.library.session.InitialEnvironment;
public class DownloadFtp extends CommandFileResult<JsonFile>{ public class DownloadFtp extends CommandFileResult<JsonFile>{
@Override @Override
public void execute(JsonFile param) throws Exception { public void execute(JsonFile param) throws Exception {
File file = new File(param.getDirectory()+"/"+param.getFileName()); String dirupload = new InitialEnvironment().getValue(param.getDirectory());
File file = new File(dirupload+"/"+param.getFileName());
if(file.exists()){ if(file.exists()){
this.setFile(FileFtpFactory.getInstance().createJsonFile(file)); this.setFile(FileFtpFactory.getInstance().createJsonFile(file));
this.sendMessage("DownloadFtp : Success" , CommandState.success); this.sendMessage("DownloadFtp : Success" , CommandState.success);
......
...@@ -5,13 +5,15 @@ import java.io.File; ...@@ -5,13 +5,15 @@ import java.io.File;
import com.csc.library.command.CommandNoResult; import com.csc.library.command.CommandNoResult;
import com.csc.library.properties.JsonFile; import com.csc.library.properties.JsonFile;
import com.csc.library.properties.JsonFileImpl; import com.csc.library.properties.JsonFileImpl;
import com.csc.library.session.InitialEnvironment;
public class UploadFtp extends CommandNoResult<JsonFile>{ public class UploadFtp extends CommandNoResult<JsonFile>{
@Override @Override
public void execute(JsonFile jsonFile) throws Exception { public void execute(JsonFile jsonFile) throws Exception {
if(jsonFile != null){ if(jsonFile != null){
jsonFile.writeFile(jsonFile.getDirectory()+"/"+jsonFile.getFileName()); String dirupload = new InitialEnvironment().getValue(jsonFile.getDirectory());
jsonFile.writeFile(dirupload+"/"+jsonFile.getFileName());
} }
} }
} }
...@@ -38,10 +38,11 @@ public class CommandSpecialBase extends CommandLists<List<String>>{ ...@@ -38,10 +38,11 @@ public class CommandSpecialBase extends CommandLists<List<String>>{
record.put(field, ds.getString(field)); record.put(field, ds.getString(field));
} }
this.putNewRecord(record); this.putNewRecord(record);
this.setCommandState(CommandState.success);
} }
this.setCommandState(CommandState.success);
}catch(Exception e){ }catch(Exception e){
MyLog.error(this ,this.getUProfile() , e); MyLog.error(this ,this.getUProfile() , e);
this.setCommandState(CommandState.fail);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment