developer logo

sv:file

A file node is located in a file repository (sv:fileRepository) or a local file repository (sv:localFileRepository). It has no children.

Node name

Name

Type and description

<file-name>

Dynamic / Model dependent


The name of the file (e.g. "aFile.pdf"). 

Properties

Name

Type and description 

createdBy

javax.jcr.PropertyType.WEAKREFERENCE

 

The user that created the file



 creationDate

javax.jcr.PropertyType.DATE 


Date when the file was created.



 description

javax.jcr.PropertyType.STRING


A given description of the file



 displayName

javax.jcr.PropertyType.STRING


The name of the file



 downloadProtected

javax.jcr.PropertyType.BOOLEAN 


Whether or not the file is temporarily download protected [@since SiteVision 3.1]



 fileName

javax.jcr.PropertyType.STRING


The physical file name



 lastModifiedBy

javax.jcr.PropertyType.WEAKREFERENCE


The user that modified the file



 lastModifiedDate

javax.jcr.PropertyType.DATE


Date when the file was modified.



length

javax.jcr.PropertyType.LONG


The length of the file [@since SiteVision 2.6.2_03]



locale

javax.jcr.PropertyType.STRING 


Language settings



 mimeType

javax.jcr.PropertyType.STRING 


The file mime type*



resourcePriority

javax.jcr.PropertyType.LONG


The search resource priority, influences document boost when indexed [@since SiteVision 3.6.4]



robotsIndex

javax.jcr.PropertyType.BOOLEAN


Indicates whether or not the file may be indexed by a web robot 



URI

javax.jcr.PropertyType.URI


The relative URI of the file 



URL

javax.jcr.PropertyType.URI 


The absolute URI of the file 



visibleInMenus

javax.jcr.PropertyType.BOOLEAN 


Indicates whether or not the file is visible in menus 

Note that the "mimeType" property gets its value when the file is created. Though, SiteVision always resolvs a proper MIME dynamically whenever a file is requested/downloaded. The mimeType property and the resolved MIME might differ. Use MimeTypeUtil if you must get the exact MIME that clients will get as header when downloading the file.

SiteVision Utility API tip!

  • ​The FileUtil interface exposes a set of methods for creating a sv:file
  • The FileIconRenderer can be used to render file icons for a specific file (i.e. file extension).
  • The actual binary content of a sv:file can be read via an InputStream of a Binary. The PropertyUtil interface exposes a set of methods for getting the Binary for a sv:file.
  • The MimeTypeUtil interface exposes a set of methods related to MIME (Content-Type)
  • The StructureUtil interface exposes a set of methods to move a sv:file to another parent.
  • The TrashcanUtil interface provides a set of methods to remove or restore a sv:file.
  • The LinkRenderer interface can be used to render a link to a sv:file.