Class FileHandle

    • Field Detail

      • CRUD_FILE_PROPS

        public static final Map<String,​Object> CRUD_FILE_PROPS
      • CRUD_CONTENT_PROPS

        public static final Map<String,​Object> CRUD_CONTENT_PROPS
      • name

        protected transient String name
      • extension

        protected transient String extension
      • mimeType

        protected transient String mimeType
      • encoding

        protected transient String encoding
      • lastModified

        protected transient Calendar lastModified
    • Constructor Detail

      • FileHandle

        public FileHandle​(@Nullable
                          @Nullable org.apache.sling.api.resource.Resource resource)
    • Method Detail

      • getContent

        public ResourceHandle getContent()
        Handle to the content node of the file; not null.
      • getResource

        public ResourceHandle getResource()
        Handle to the main node of the file; not null.
      • isValid

        public boolean isValid()
      • getPath

        public String getPath()
      • getName

        public String getName()
      • getExtension

        public String getExtension()
      • getMimeType

        public String getMimeType()
      • getEncoding

        public String getEncoding()
      • getLastModified

        public Calendar getLastModified()
      • getSize

        public Long getSize()
      • storeContent

        public void storeContent​(InputStream stream)
      • updateLastModified

        public void updateLastModified()
        Updates the last modified value, if the mix:lastModified is present.
      • retrieveNameAndExt

        protected void retrieveNameAndExt()