Java Code Examples for com.xnx3.file.FileUtil#downFiles()

The following examples show how to use com.xnx3.file.FileUtil#downFiles() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Cache.java    From templatespider with Apache License 2.0 5 votes vote down vote up
/**
 * 将 {@link #cacheMap} 缓存到本地磁盘,文件下载
 */
public static synchronized void downFile(Resource resource){
	try {
		FileUtil.downFiles(resource.getNetUrl(), resource.getLocalUrl());
	}catch(java.io.FileNotFoundException notFind){
		Global.log("404 File Not Found !  "+resource.getNetUrl());
	}catch(java.lang.NullPointerException nullE){
		Global.log("downFile NULL----- "+resource.getNetUrl());
	}catch (Exception e) {
		Global.log(e.getMessage()+" --- "+resource.getNetUrl());
		e.printStackTrace();
	}
}
 
Example 2
Source File: Cache.java    From templatespider with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws IOException {
	FileUtil.downFiles("http://www.xingyucjb.com/Public/Wap/images/b4.png", "/images/js/b4.png");
}
 
Example 3
Source File: Test.java    From xnx3 with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
	
	try {
		FileUtil.downFiles("http://res.weiunity.com/template/qiye1/images/icon-sns-zh.gif", "/Users/apple/Desktop/icon-sns-zh.gif");
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
}