Class ZipFileSite
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.snap.web.WebSite
-
- com.inductiveautomation.snap.websites.ZipFileSite
-
- All Implemented Interfaces:
RMJSONArchiver.GetKeys,RMPropertyChanger,java.beans.PropertyChangeListener,java.lang.Cloneable,java.util.EventListener
- Direct Known Subclasses:
JarFileSite
public class ZipFileSite extends WebSite
A WebSite subclass for Zip files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZipFileSite.ZipDataFileA ZipFile.-
Nested classes/interfaces inherited from class com.inductiveautomation.snap.web.WebSite
WebSite.Servlet
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.snap.web.WebSite
Refresh_Prop
-
-
Constructor Summary
Constructors Constructor Description ZipFileSite()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddZipEntry(java.util.zip.ZipEntry anEntry)Adds a ZipEntry to WebSite.protected WebFilecreateFileImpl(java.lang.String aPath, boolean isDirectory)Override to return ZipDataFile.protected java.util.zip.ZipFilecreateZipFile()Creates the ZipFile.protected voiddeleteFileImpl(WebFile aFile)Deletes a file.protected voiddeleteRowImpl(Row aRow)Deletes a given row.protected byte[]getFileBytesImpl(WebFile aFile)Returns file bytes.protected WebFilegetFileImpl(java.lang.String aPath)Returns a data source file for given path (if file exists).protected java.util.ListgetFilesImpl(WebFile aFile)Returns a list of files at path.ResponsegetResponse(Request aRequest)Override to load files when first file is requested.protected java.util.List<Row>getRowsImpl(Entity anEntity, Query aQuery)Returns a set of rows for the given properties and condition.protected java.io.FilegetStandardFile()Returns a Java file for the zip file URL (copied to Sandbox if remote).protected java.util.zip.ZipFilegetZipFile()Returns the ZipFile.protected voidloadArchive()Loads WebSite from Archive (zip) file.protected voidsaveFileImpl(WebFile aFile)Saves a file.protected voidsaveRowImpl(Row aRow)Inserts or updates a given row.-
Methods inherited from class com.inductiveautomation.snap.web.WebSite
addDeepChangeListener, bulkImport, createClassLoader, createDataTable, createDataTableImpl, createEntity, createEntityImpl, createFile, createRow, createRow, createRowImpl, createSandbox, createSandboxURL, createSandboxURLS, createSchema, createSite, createURL, deleteEntity, deleteEntityImpl, deleteFile, deleteRow, deleteSite, flush, flushImpl, getClassLoader, getDataTable, getDataTables, getEntity, getEntityImpl, getExists, getFile, getHostName, getJSONKeys, getModifiedTime, getName, getPassword, getPath, getProp, getRequest, getRootDirectory, getRow, getRow, getRowImpl, getRows, getSandbox, getSchema, getServlet, getStandardFile, getURL, getURL, getURLString, getUserName, handleDelete, handleGet, handleHead, handlePut, isRunning, propertyChange, refresh, refreshFile, refreshFileImpl, removeDeepChangeListener, saveEntity, saveEntityImpl, saveFile, saveRow, setClassLoader, setExists, setModifiedTime, setModifiedTimeImpl, setPassword, setProp, setSandbox, setServlet, setURL, setUserName, toString
-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
Method Detail
-
loadArchive
protected void loadArchive()
Loads WebSite from Archive (zip) file.
-
getZipFile
protected java.util.zip.ZipFile getZipFile() throws java.lang.ExceptionReturns the ZipFile.- Throws:
java.lang.Exception
-
createZipFile
protected java.util.zip.ZipFile createZipFile() throws java.lang.ExceptionCreates the ZipFile.- Throws:
java.lang.Exception
-
getStandardFile
protected java.io.File getStandardFile() throws java.lang.ExceptionReturns a Java file for the zip file URL (copied to Sandbox if remote).- Throws:
java.lang.Exception
-
addZipEntry
protected void addZipEntry(java.util.zip.ZipEntry anEntry)
Adds a ZipEntry to WebSite.
-
createFileImpl
protected WebFile createFileImpl(java.lang.String aPath, boolean isDirectory)
Override to return ZipDataFile.- Overrides:
createFileImplin classWebSite
-
getResponse
public Response getResponse(Request aRequest)
Override to load files when first file is requested.- Overrides:
getResponsein classWebSite
-
getFileImpl
protected WebFile getFileImpl(java.lang.String aPath)
Returns a data source file for given path (if file exists).- Overrides:
getFileImplin classWebSite
-
getFilesImpl
protected java.util.List getFilesImpl(WebFile aFile) throws java.lang.Exception
Returns a list of files at path.- Overrides:
getFilesImplin classWebSite- Throws:
java.lang.Exception
-
getFileBytesImpl
protected byte[] getFileBytesImpl(WebFile aFile) throws java.lang.Exception
Returns file bytes.- Overrides:
getFileBytesImplin classWebSite- Throws:
java.lang.Exception
-
saveFileImpl
protected void saveFileImpl(WebFile aFile) throws java.lang.Exception
Saves a file.- Overrides:
saveFileImplin classWebSite- Throws:
java.lang.Exception
-
deleteFileImpl
protected void deleteFileImpl(WebFile aFile) throws java.lang.Exception
Deletes a file.- Overrides:
deleteFileImplin classWebSite- Throws:
java.lang.Exception
-
getRowsImpl
protected java.util.List<Row> getRowsImpl(Entity anEntity, Query aQuery)
Description copied from class:WebSiteReturns a set of rows for the given properties and condition.- Specified by:
getRowsImplin classWebSite
-
saveRowImpl
protected void saveRowImpl(Row aRow)
Description copied from class:WebSiteInserts or updates a given row.- Specified by:
saveRowImplin classWebSite
-
deleteRowImpl
protected void deleteRowImpl(Row aRow)
Description copied from class:WebSiteDeletes a given row.- Specified by:
deleteRowImplin classWebSite
-
-