本文整理匯總了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);
}