jiapeng преди 6 години
родител
ревизия
7b75ca660b

+ 6 - 6
src/main/java/com/ekexiu/project/hdfs/HdfsService.java

@ -12,7 +12,7 @@ public class HdfsService {
12 12
//	private Configuration configuration = new Configuration();
13 13
//	private DistributedFileSystem dfs;
14 14
//	private Path root = new Path("/");
15
//	private String remoteUrl;
15
	private String remoteUrl;
16 16
//	
17 17
//
18 18
//
@ -20,12 +20,12 @@ public class HdfsService {
20 20
//		this.root = new Path(rootPath);
21 21
//	}
22 22
//	
23
//	public String getRemoteUrl() {
24
//		return remoteUrl;
25
//	}
23
	public String getRemoteUrl() {
24
		return remoteUrl;
25
	}
26 26
//
27 27
//
28
//	public void setRemoteUrl(String remoteUrl) {
28
	public void setRemoteUrl(String remoteUrl) {
29 29
//		System.setProperty("HADOOP_USER_NAME", "hadoop");
30 30
//		this.remoteUrl = remoteUrl;
31 31
//		configuration.set("fs.default.name", this.remoteUrl);
@ -35,7 +35,7 @@ public class HdfsService {
35 35
//		} catch (IOException e) {
36 36
//			throw new RuntimeException(e);
37 37
//		}
38
//	}
38
	}
39 39
	
40 40
	public void upload(String path,File src) throws IOException{
41 41
//		byte[] buffer = new byte[8192];

+ 3 - 3
src/main/java/com/ekexiu/project/storage/diacrisis/AiTaskService.java

@ -241,11 +241,11 @@ public class AiTaskService {
241 241
	   
242 242
	   for(String f:file){
243 243
		   int idx = f.indexOf('.');
244
		   if(idx!=16){
244
		   if(idx!=32){
245 245
			   throw new IllegalArgumentException("invalid param file");
246 246
		   }
247
		   File taskSrc = new File(this.uploadPath,f.substring(0,16));
248
		   File taskDst = new File(path,f.substring(17));
247
		   File taskSrc = new File(this.uploadPath,f.substring(0,32));
248
		   File taskDst = new File(path,f.substring(33));
249 249
		   InputStream in = new FileInputStream(taskSrc);
250 250
		   try{
251 251
			  OutputStream os = new FileOutputStream(taskDst) ;