Class ZipChemCompProvider
- java.lang.Object
- 
- org.biojava.nbio.structure.io.mmcif.ZipChemCompProvider
 
- 
- All Implemented Interfaces:
- ChemCompProvider
 
 public class ZipChemCompProvider extends Object implements ChemCompProvider This chemical component provider retrieves and caches chemical component definition files from a zip archive specified in its construction. If the archive does not contain the record, an attempt is made to download it using DownloadChemCompProvider. The downloaded file is then added to the archive. The class is thread-safe and the same ZipChemCompProvider should be used by all threads to prevent simultaneous read or write to the zip archive. A zip archive will be created if missing.- Since:
- 12/05/12 updated 3/5/2016 for Java 7 ZipFileSystem
- Author:
- edlunde, larsonm
 
- 
- 
Constructor SummaryConstructors Constructor Description ZipChemCompProvider(String chemicalComponentDictionaryFile, String tempDir)ZipChemCompProvider is a Chemical Component provider that stores chemical components in a zip archive.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChemCompgetChemComp(String recordName)Returns a new instance of a chemical component definition.static voidpurgeTempFiles(String tempdir)Cleanup chemical component (.cif.gz) files downloaded to tmpdir.voidsetRemoveCif(boolean doRemove)Remove downloaded .cif.gz after adding to zip archive?
 
- 
- 
- 
Constructor Detail- 
ZipChemCompProviderpublic ZipChemCompProvider(String chemicalComponentDictionaryFile, String tempDir) throws IOException ZipChemCompProvider is a Chemical Component provider that stores chemical components in a zip archive. Missing chemical components are downloaded and appended to the archive. If non-existent a new zip archive will be created.- Parameters:
- chemicalComponentDictionaryFile- : path to zip archive for chemical components.
- tempDir- : path for temporary directory, (null) defaults to path in property "java.io.tmpdir".
- Throws:
- IOException
 
 
- 
 - 
Method Detail- 
setRemoveCifpublic void setRemoveCif(boolean doRemove) Remove downloaded .cif.gz after adding to zip archive? Default is true.- Parameters:
- doRemove-
 
 - 
getChemComppublic ChemComp getChemComp(String recordName) Description copied from interface:ChemCompProviderReturns a new instance of a chemical component definition.- Specified by:
- getChemCompin interface- ChemCompProvider
- Parameters:
- recordName- the ID of the- ChemComp
- Returns:
- a new ChemCompdefinition.
 
 - 
purgeTempFilespublic static void purgeTempFiles(String tempdir) Cleanup chemical component (.cif.gz) files downloaded to tmpdir.- Parameters:
- tempdir- : path to temporary directory for chemical components
 
 
- 
 
-