Class DirectoryStore

  • All Implemented Interfaces:
    Store, tigase.kernel.beans.config.ConfigurationChangedAware

    @Bean(name="store",
          parent=FileUploadComponent.class,
          active=true,
          exportable=true)
    public class DirectoryStore
    extends java.lang.Object
    implements Store, tigase.kernel.beans.config.ConfigurationChangedAware
    Created by andrzej on 08.08.2016.
    • Constructor Summary

      Constructors 
      Constructor Description
      DirectoryStore()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void beanConfigurationChanged​(java.util.Collection<java.lang.String> collection)  
      long count()
      Returns number of elements in store
      java.nio.channels.ReadableByteChannel getContent​(tigase.xmpp.jid.BareJID uploader, java.lang.String slotId, java.lang.String filename)
      Method to retrieve content of file from slot
      protected java.nio.file.Path prepareSlotPath​(tigase.xmpp.jid.BareJID uploader, java.lang.String slotId)  
      void remove​(tigase.xmpp.jid.BareJID uploader, java.lang.String slotId)
      Method removes content of slot
      protected void removeWithContent​(java.nio.file.Path path)  
      void setContent​(tigase.xmpp.jid.BareJID uploader, java.lang.String slotId, java.lang.String filename, long size, java.nio.channels.ReadableByteChannel source)
      Method to set content of file to slot
      void setPath​(java.lang.String path)  
      long size()
      Returns size used by store
      • Methods inherited from class java.lang.Object

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

      • DirectoryStore

        public DirectoryStore()
    • Method Detail

      • setPath

        public void setPath​(java.lang.String path)
      • count

        public long count()
                   throws java.io.IOException
        Description copied from interface: Store
        Returns number of elements in store
        Specified by:
        count in interface Store
        Throws:
        java.io.IOException
      • size

        public long size()
                  throws java.io.IOException
        Description copied from interface: Store
        Returns size used by store
        Specified by:
        size in interface Store
        Throws:
        java.io.IOException
      • getContent

        public java.nio.channels.ReadableByteChannel getContent​(tigase.xmpp.jid.BareJID uploader,
                                                                java.lang.String slotId,
                                                                java.lang.String filename)
                                                         throws java.io.IOException
        Description copied from interface: Store
        Method to retrieve content of file from slot
        Specified by:
        getContent in interface Store
        Throws:
        java.io.IOException
      • setContent

        public void setContent​(tigase.xmpp.jid.BareJID uploader,
                               java.lang.String slotId,
                               java.lang.String filename,
                               long size,
                               java.nio.channels.ReadableByteChannel source)
                        throws java.io.IOException
        Description copied from interface: Store
        Method to set content of file to slot
        Specified by:
        setContent in interface Store
        Throws:
        java.io.IOException
      • remove

        public void remove​(tigase.xmpp.jid.BareJID uploader,
                           java.lang.String slotId)
        Description copied from interface: Store
        Method removes content of slot
        Specified by:
        remove in interface Store
      • beanConfigurationChanged

        public void beanConfigurationChanged​(java.util.Collection<java.lang.String> collection)
        Specified by:
        beanConfigurationChanged in interface tigase.kernel.beans.config.ConfigurationChangedAware
      • prepareSlotPath

        protected java.nio.file.Path prepareSlotPath​(tigase.xmpp.jid.BareJID uploader,
                                                     java.lang.String slotId)
      • removeWithContent

        protected void removeWithContent​(java.nio.file.Path path)