Class SnapData

    • 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 WebURL createSourceURL()
      Creates the source URL from source if possible.
      void delete()
      Override to delete entity.
      static <T extends SnapData>
      T
      get​(WebFile aFile, java.lang.Class<T> aClass)
      Returns the data for given file as given SnapData subclass.
      byte[] getBytes()
      Returns the bytes.
      java.io.InputStream getInputStream()
      Returns an input stream for the data.
      WebSite getSite()
      Returns the site for this data.
      java.lang.Object getSource()
      Returns the source.
      WebFile getSourceFile()
      Returns the source file.
      WebURL getSourceURL()
      Returns the source URL.
      static boolean is​(WebFile aFile, java.lang.Class aClass)
      Returns whether given file is of given data type.
      void refresh()
      Reverts file.
      void save()
      Saves the file.
      void setBytes​(byte[] theBytes)
      Sets the bytes.
      void setSource​(java.lang.Object aSource)
      Sets the source.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SnapData

        public SnapData()
    • 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.Exception
        Saves the file.
        Throws:
        java.lang.Exception
      • delete

        public void delete()
                    throws java.lang.Exception
        Override 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.
      • get

        public static <T extends SnapData> T get​(WebFile aFile,
                                                 java.lang.Class<T> aClass)
        Returns the data for given file as given SnapData subclass.