Class FileSite
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.snap.web.WebSite
-
- com.inductiveautomation.snap.websites.FileSite
-
- All Implemented Interfaces:
RMJSONArchiver.GetKeys,RMPropertyChanger,java.beans.PropertyChangeListener,java.lang.Cloneable,java.util.EventListener
- Direct Known Subclasses:
EclipseSite,LocalSite,SandboxSite
public class FileSite extends WebSite
A data source to read/write data and files to a file system.
-
-
Nested Class Summary
-
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 FileSite()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddeleteEntityImpl(Entity anEntity)Delete entity file and entity table data file.protected voiddeleteFileImpl(WebFile aFile)Deletes file.protected voiddeleteRowImpl(Row aRow)Deletes a given row.voiddeleteSite()Deletes this data source, assuming it corresponds to something that can be deleted, like a database.protected voidflushImpl()Override to Saves changes if any made.protected EntitygetEntityImpl(java.lang.String aName)Get entity by loading from entity file.protected java.util.List<Row>getEntityRows(Entity anEntity)Returns the list of rows for a given entity.protected byte[]getFileBytesImpl(WebFile aFile)Gets file bytes.protected WebFilegetFileImpl(java.lang.String aPath)Returns a file atprotected java.util.List<WebFile>getFilesImpl(WebFile aFile)Returns files at path.longgetModifiedTime(WebFile aFile)Override to get modified time from Java file.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(WebFile aFile)Returns the Java file for a WebFile.protected java.io.FilegetStandardFile(java.lang.String aPath)Returns the Java file for RMFile.protected WebFilegetTableDataFile(java.lang.String aName, boolean doCreate)Returns the file for the given entity.protected WebFilegetTableEntityFile(java.lang.String aName, boolean doCreate)Returns the file for the given entity.protected voidsaveEntityFile(Entity anEntity)Save entity files for changed entities.protected voidsaveEntityFiles()Save entity files for changed entities.protected voidsaveEntityImpl(Entity anEntity)Save entity by saving entity bytes to entity file.protected voidsaveFileImpl(WebFile aFile)Writes file bytes.protected voidsaveRowImpl(Row aRow)Inserts or updates a given row.protected voidsetModifiedTimeImpl(WebFile aFile, long aTime)Saves the modified time for a file to underlying file system.-
Methods inherited from class com.inductiveautomation.snap.web.WebSite
addDeepChangeListener, bulkImport, createClassLoader, createDataTable, createDataTableImpl, createEntity, createEntityImpl, createFile, createFileImpl, createRow, createRow, createRowImpl, createSandbox, createSandboxURL, createSandboxURLS, createSchema, createSite, createURL, deleteEntity, deleteFile, deleteRow, flush, getClassLoader, getDataTable, getDataTables, getEntity, getExists, getFile, getHostName, getJSONKeys, getName, getPassword, getPath, getProp, getRequest, getResponse, getRootDirectory, getRow, getRow, getRowImpl, getRows, getSandbox, getSchema, getServlet, getURL, getURL, getURLString, getUserName, handleDelete, handleGet, handleHead, handlePut, isRunning, propertyChange, refresh, refreshFile, refreshFileImpl, removeDeepChangeListener, saveEntity, saveFile, saveRow, setClassLoader, setExists, setModifiedTime, 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
-
getFileImpl
protected WebFile getFileImpl(java.lang.String aPath)
Returns a file at- Overrides:
getFileImplin classWebSite
-
getFilesImpl
protected java.util.List<WebFile> getFilesImpl(WebFile aFile) throws java.lang.Exception
Returns files at path.- Overrides:
getFilesImplin classWebSite- Throws:
java.lang.Exception
-
getFileBytesImpl
protected byte[] getFileBytesImpl(WebFile aFile) throws java.lang.Exception
Gets file bytes.- Overrides:
getFileBytesImplin classWebSite- Throws:
java.lang.Exception
-
saveFileImpl
protected void saveFileImpl(WebFile aFile) throws java.lang.Exception
Writes file bytes.- Overrides:
saveFileImplin classWebSite- Throws:
java.lang.Exception
-
deleteFileImpl
protected void deleteFileImpl(WebFile aFile) throws java.lang.Exception
Deletes file.- Overrides:
deleteFileImplin classWebSite- Throws:
java.lang.Exception
-
getModifiedTime
public long getModifiedTime(WebFile aFile)
Override to get modified time from Java file.- Overrides:
getModifiedTimein classWebSite
-
setModifiedTimeImpl
protected void setModifiedTimeImpl(WebFile aFile, long aTime) throws java.lang.Exception
Saves the modified time for a file to underlying file system.- Overrides:
setModifiedTimeImplin classWebSite- Throws:
java.lang.Exception
-
getEntityImpl
protected Entity getEntityImpl(java.lang.String aName) throws java.lang.Exception
Get entity by loading from entity file.- Overrides:
getEntityImplin classWebSite- Throws:
java.lang.Exception
-
saveEntityImpl
protected void saveEntityImpl(Entity anEntity) throws java.lang.Exception
Save entity by saving entity bytes to entity file.- Overrides:
saveEntityImplin classWebSite- Throws:
java.lang.Exception
-
deleteEntityImpl
protected void deleteEntityImpl(Entity anEntity) throws java.lang.Exception
Delete entity file and entity table data file.- Overrides:
deleteEntityImplin classWebSite- Throws:
java.lang.Exception
-
getRowsImpl
protected java.util.List<Row> getRowsImpl(Entity anEntity, Query aQuery)
Returns a set of rows for the given properties and condition.- Specified by:
getRowsImplin classWebSite
-
saveRowImpl
protected void saveRowImpl(Row aRow)
Inserts or updates a given row.- Specified by:
saveRowImplin classWebSite
-
deleteRowImpl
protected void deleteRowImpl(Row aRow)
Deletes a given row.- Specified by:
deleteRowImplin classWebSite
-
saveEntityFiles
protected void saveEntityFiles() throws java.lang.ExceptionSave entity files for changed entities.- Throws:
java.lang.Exception
-
saveEntityFile
protected void saveEntityFile(Entity anEntity) throws java.lang.Exception
Save entity files for changed entities.- Throws:
java.lang.Exception
-
flushImpl
protected void flushImpl() throws java.lang.ExceptionOverride to Saves changes if any made.
-
getTableEntityFile
protected WebFile getTableEntityFile(java.lang.String aName, boolean doCreate)
Returns the file for the given entity.
-
getTableDataFile
protected WebFile getTableDataFile(java.lang.String aName, boolean doCreate)
Returns the file for the given entity.
-
getEntityRows
protected java.util.List<Row> getEntityRows(Entity anEntity)
Returns the list of rows for a given entity.
-
deleteSite
public void deleteSite() throws java.lang.ExceptionDeletes this data source, assuming it corresponds to something that can be deleted, like a database.- Overrides:
deleteSitein classWebSite- Throws:
java.lang.Exception
-
getStandardFile
protected java.io.File getStandardFile(WebFile aFile)
Returns the Java file for a WebFile.- Overrides:
getStandardFilein classWebSite
-
getStandardFile
protected java.io.File getStandardFile(java.lang.String aPath)
Returns the Java file for RMFile.
-
-