Package gov.nasa.worldwind.cache
Class BasicDataFileStore.PostProcessor
- java.lang.Object
-
- gov.nasa.worldwind.retrieve.AbstractRetrievalPostProcessor
-
- gov.nasa.worldwind.cache.BasicDataFileStore.PostProcessor
-
- All Implemented Interfaces:
RetrievalPostProcessor
- Enclosing class:
- BasicDataFileStore
protected class BasicDataFileStore.PostProcessor extends AbstractRetrievalPostProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringaddressprotected java.net.URLlocalFileUrlprotected java.io.FileoutputFileprotected java.net.URLretrievalUrlprotected booleansaveInLocalCache-
Fields inherited from class gov.nasa.worldwind.retrieve.AbstractRetrievalPostProcessor
avList, retriever
-
-
Constructor Summary
Constructors Constructor Description PostProcessor(java.lang.String address, java.net.URL url, boolean saveInLocalCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.io.FiledoGetOutputFile()Abstract method that subclasses must provide to identify the output file for the post-processor's retrieval content.protected java.nio.ByteBufferhandleSuccessfulRetrieval()Process the retrieved data if it has been retrieved successfully.protected java.nio.ByteBufferhandleTextContent()Handles Text content.protected java.io.FilemakeOutputFile()protected voidmarkResourceAbsent()Marks the retrieval target absent.protected booleanoverwriteExistingFile()Indicates whether the retrieved data should be written to the output file if a file of the same name already exists.protected booleansaveBuffer()Saves the retrieved and possibly transformed data.-
Methods inherited from class gov.nasa.worldwind.retrieve.AbstractRetrievalPostProcessor
convertToDDS, getFileLock, getOutputFile, getRetriever, handleApplicationContent, handleContent, handleContentException, handleHTMLContent, handleImageContent, handleInvalidResponseCode, handleUnknownContentType, handleUnsuccessfulRetrieval, handleWMSExceptionContent, handleXMLContent, handleZipContent, isDeleteOnExit, isPrimaryContentType, isWMSException, logTextBuffer, run, saveBuffer, saveDDS, transformPixels, validateHTTPResponseCode, validateJarResponseCode, validateResponseCode
-
-
-
-
Method Detail
-
overwriteExistingFile
protected boolean overwriteExistingFile()
Description copied from class:AbstractRetrievalPostProcessorIndicates whether the retrieved data should be written to the output file if a file of the same name already exists. The default implementation of this method returns false (files are not overwritten).- Overrides:
overwriteExistingFilein classAbstractRetrievalPostProcessor- Returns:
- true if an existing file should be overwritten, otherwise false.
-
doGetOutputFile
protected java.io.File doGetOutputFile()
Description copied from class:AbstractRetrievalPostProcessorAbstract method that subclasses must provide to identify the output file for the post-processor's retrieval content.- Specified by:
doGetOutputFilein classAbstractRetrievalPostProcessor- Returns:
- the output file.
-
makeOutputFile
protected java.io.File makeOutputFile()
-
saveBuffer
protected boolean saveBuffer() throws java.io.IOExceptionDescription copied from class:AbstractRetrievalPostProcessorSaves the retrieved and possibly transformed data. The data may have been transformed during content handling.The default implementation of this method simply calls
AbstractRetrievalPostProcessor.saveBuffer(java.nio.ByteBuffer)with an argument of null.- Overrides:
saveBufferin classAbstractRetrievalPostProcessor- Returns:
- true if the buffer was saved, false if the output file could not be determined or already exists and not overwritten.
- Throws:
java.io.IOException- if an IO error occurs while attempting to save the buffer.
-
handleSuccessfulRetrieval
protected java.nio.ByteBuffer handleSuccessfulRetrieval()
Description copied from class:AbstractRetrievalPostProcessorProcess the retrieved data if it has been retrieved successfully.- Overrides:
handleSuccessfulRetrievalin classAbstractRetrievalPostProcessor- Returns:
- a buffer containing the downloaded data, perhaps converted during content handling.
-
markResourceAbsent
protected void markResourceAbsent()
Description copied from class:AbstractRetrievalPostProcessorMarks the retrieval target absent. Subclasses should override this method if they keep track of absent-resources. The default implementation does nothing.- Overrides:
markResourceAbsentin classAbstractRetrievalPostProcessor
-
handleTextContent
protected java.nio.ByteBuffer handleTextContent() throws java.io.IOExceptionHandles Text content. If the content type is text/xml,AbstractRetrievalPostProcessor.handleXMLContent()is called. If the content type is text/html,AbstractRetrievalPostProcessor.handleHTMLContent()is called. For all other sub-types the content is logged as a message with levelLevel.SEVERE. Overridden to save text files in the cache.- Overrides:
handleTextContentin classAbstractRetrievalPostProcessor- Returns:
- a buffer containing the retrieved text.
- Throws:
java.io.IOException- if an IO error occurs while processing the data.
-
-