Subversion Repositories SmartDukaan

Rev

Rev 8608 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8608 Rev 8615
Line 1... Line 1...
1
package in.shop2020.support.controllers;
1
package in.shop2020.support.controllers;
2
 
2
 
3
import java.io.File;
3
import java.io.File;
4
import java.io.IOException;
4
import java.io.IOException;
-
 
5
 
-
 
6
import javax.xml.bind.JAXBException;
-
 
7
 
5
import org.apache.commons.io.FileUtils;
8
import org.apache.commons.io.FileUtils;
-
 
9
import in.shop2020.ProcessSnapdealOrder;
6
 
10
 
7
public class FileUploadController {
11
public class FileUploadController {
8
	/**
12
	/**
9
	 * 
13
	 * 
10
	 */
14
	 */
11
	private static final long serialVersionUID = 1L;
15
	private static final long serialVersionUID = 1L;
12
 
16
 
13
	private File file;
17
	private File file;
14
	
18
	
15
	public void upload() throws IOException{
19
	public void upload() throws IOException{
16
		File fileToCreate = new File("/tmp/", "snapdeal-order.xml");
20
		File fileToCreate = new File("/tmp/", "snapdeal-order.xml-"+System.currentTimeMillis());
17
		FileUtils.copyFile(this.file, fileToCreate);
21
		FileUtils.copyFile(this.file, fileToCreate);
-
 
22
		try {
-
 
23
			ProcessSnapdealOrder.processSnapdealOrders(file);
-
 
24
		} catch (JAXBException e) {
-
 
25
			// TODO Auto-generated catch block
-
 
26
			e.printStackTrace();
-
 
27
		}
-
 
28
		
18
	}
29
	}
19
 
-
 
20
	public void setFile(File file) {
30
	public void setFile(File file) {
21
		this.file = file;
31
		this.file = file;
22
	}
32
	}
23
	
-
 
24
 
-
 
25
	
-
 
26
	
-
 
27
	
-
 
28
	
-
 
29
	
-
 
30
	
-
 
31
	
-
 
32
	
-
 
33
	
-
 
34
	
-
 
35
	
-
 
36
	
-
 
37
	
-
 
38
	
-
 
39
	
-
 
40
}
33
}
41
34