Class SnapData
- java.lang.Object
-
- com.inductiveautomation.snap.filedata.SnapData
-
- Direct Known Subclasses:
ClassData,HTMLData,JavaData,MidiData,ReportData,TableData,TableViewData
public class SnapData extends java.lang.ObjectRepresents the data (from a file)
-
-
Constructor Summary
Constructors Constructor Description SnapData()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]createBytes()Creates the bytes.protected WebURLcreateSourceURL()Creates the source URL from source if possible.voiddelete()Override to delete entity.static <T extends SnapData>
Tget(WebFile aFile, java.lang.Class<T> aClass)Returns the data for given file as given SnapData subclass.byte[]getBytes()Returns the bytes.java.io.InputStreamgetInputStream()Returns an input stream for the data.WebSitegetSite()Returns the site for this data.java.lang.ObjectgetSource()Returns the source.WebFilegetSourceFile()Returns the source file.WebURLgetSourceURL()Returns the source URL.static booleanis(WebFile aFile, java.lang.Class aClass)Returns whether given file is of given data type.voidrefresh()Reverts file.voidsave()Saves the file.voidsetBytes(byte[] theBytes)Sets the bytes.voidsetSource(java.lang.Object aSource)Sets the source.
-
-
-
Method Detail
-
getSource
public java.lang.Object getSource()
Returns the source.
-
setSource
public void setSource(java.lang.Object aSource)
Sets the source.
-
getSourceURL
public WebURL getSourceURL()
Returns the source URL.
-
createSourceURL
protected WebURL createSourceURL()
Creates the source URL from source if possible.
-
getSourceFile
public WebFile getSourceFile()
Returns the source file.
-
getSite
public WebSite getSite()
Returns the site for this data.
-
getBytes
public byte[] getBytes()
Returns the bytes.
-
createBytes
protected byte[] createBytes()
Creates the bytes.
-
setBytes
public void setBytes(byte[] theBytes)
Sets the bytes.
-
getInputStream
public java.io.InputStream getInputStream()
Returns an input stream for the data.
-
save
public void save() throws java.lang.ExceptionSaves the file.- Throws:
java.lang.Exception
-
delete
public void delete() throws java.lang.ExceptionOverride to delete entity.- Throws:
java.lang.Exception
-
refresh
public void refresh()
Reverts file.
-
is
public static boolean is(WebFile aFile, java.lang.Class aClass)
Returns whether given file is of given data type.
-
-