本文整理汇总了Java中org.gbif.dwc.text.ArchiveFactory类的典型用法代码示例。如果您正苦于以下问题:Java ArchiveFactory类的具体用法?Java ArchiveFactory怎么用?Java ArchiveFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArchiveFactory类属于org.gbif.dwc.text包,在下文中一共展示了ArchiveFactory类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DwcArchive
import org.gbif.dwc.text.ArchiveFactory; //导入依赖的package包/类
/**
* Constructor from a URI
*
* @param source
* @throws IOException
*/
public DwcArchive(URL source) throws IOException {
File dwca = File.createTempFile("dwcaFile-", null);
dwca.deleteOnExit();
System.out.println("Downloading DarwinCore archive " + source.toString());
try {
// download
DefaultHttpClient client = new DefaultHttpClient();
HttpUtil http = new HttpUtil(client);
http.download(source, dwca);
} catch (Exception e) {
System.out.println("Cannot download DarwinCore archive. Abort.");
System.exit(0);
}
location = CompressionUtil.decompressFile(dwca);
System.out.println("Uncompressed into directory: " + location.getAbsolutePath());
archive = ArchiveFactory.openArchive(location);
}