Package org.silverpeas.core.wbe
Class SimpleWbeFile
- java.lang.Object
-
- org.silverpeas.core.wbe.WbeFile
-
- org.silverpeas.core.wbe.SimpleWbeFile
-
- All Implemented Interfaces:
Securable
- Direct Known Subclasses:
DragAndDropWbeFile
public class SimpleWbeFile extends WbeFile
- Author:
- silveryocha
-
-
Constructor Summary
Constructors Constructor Description SimpleWbeFile(File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBeAccessedBy(User user)Checks the given user can access this resource.OffsetDateTimelastModificationDate()Gets anOffsetDateTimeinstance that represents the last time that the file was modified.Optional<ResourceReference>linkedToResource()Gets the optional resource reference the file is linked to.voidloadInto(OutputStream output)Loads the content of the underlying Silverpeas's file into the givenOutputStream.StringmimeType()Gets the mime type of the file.Stringname()Gets the string name of the file, including extension, without a path.Userowner()A string that uniquely identifies the owner of the file.StringsilverpeasId()Silverpeas's identifier identifies the file from point of view of Silverpeas's platform.longsize()Gets the size of the file in bytes.voidupdateFrom(InputStream input)Updates the content of underlying Silverpeas's file from data provided by the givenInputStream.-
Methods inherited from class org.silverpeas.core.wbe.WbeFile
ext, getLastEditionDate, id, lock, setLastEditionDateAtNow, toString, version
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy, canBeFiledInBy, canBeModifiedBy
-
-
-
-
Field Detail
-
MUTEX
protected static final Object MUTEX
-
-
Constructor Detail
-
SimpleWbeFile
public SimpleWbeFile(File file)
-
-
Method Detail
-
linkedToResource
public Optional<ResourceReference> linkedToResource()
Description copied from class:WbeFileGets the optional resource reference the file is linked to.- Specified by:
linkedToResourcein classWbeFile- Returns:
- an optional
ResourceReference.
-
silverpeasId
public String silverpeasId()
Description copied from class:WbeFileSilverpeas's identifier identifies the file from point of view of Silverpeas's platform.In most of case,
WbeFile.id()will return same identifier asWbeFile.silverpeasId()returns.But sometimes, when a temporary view exists for a file and that the temporary view is the content exposed for modifications,
WbeFile.silverpeasId()returns the identifier of the document andWbeFile.id()returns the identifier of the view (the one used by Web Browser Edition exchanges).- Specified by:
silverpeasIdin classWbeFile- Returns:
- a unique identifier as string.
-
owner
public User owner()
Description copied from class:WbeFileA string that uniquely identifies the owner of the file. In most cases, the user who uploaded or created the file should be considered the owner.
-
name
public String name()
Description copied from class:WbeFileGets the string name of the file, including extension, without a path. Used for display in user interface (UI), and determining the extension of the file.
-
mimeType
public String mimeType()
Description copied from class:WbeFileGets the mime type of the file.
-
size
public long size()
Description copied from class:WbeFileGets the size of the file in bytes.
-
lastModificationDate
public OffsetDateTime lastModificationDate()
Description copied from class:WbeFileGets anOffsetDateTimeinstance that represents the last time that the file was modified.- Specified by:
lastModificationDatein classWbeFile- Returns:
- an
OffsetDateTime.
-
updateFrom
public void updateFrom(InputStream input) throws IOException
Description copied from class:WbeFileUpdates the content of underlying Silverpeas's file from data provided by the givenInputStream.- Specified by:
updateFromin classWbeFile- Parameters:
input- anInputStreamfrom which the data are written.- Throws:
IOException- when it is not possible to write into the physical file.
-
loadInto
public void loadInto(OutputStream output) throws IOException
Description copied from class:WbeFileLoads the content of the underlying Silverpeas's file into the givenOutputStream.- Specified by:
loadIntoin classWbeFile- Parameters:
output- the stream into which content file MUST be loaded.- Throws:
IOException- when it is not possible to read the physical file.
-
-