Class UploadResource
java.lang.Object
org.exoplatform.upload.UploadResource
Created by The eXo Platform SARL Author : Tuan Nguyen tuan08@users.sourceforge.net Dec 26, 2005
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionUploadResource(String uploadId) UploadResource(String uploadId, String fileName) UploadResource(String uploadId, String fileName, String mimeType, String storeLocation, double uploadedSize, double estimatedSize, int status) Builds a resource with all its upload attributes and no owner. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUploadedBytes(double size) doublegetOwner()Returns the user who uploaded the resource: the authenticated user of the upload request, or the user an upload token was issued for.intdoublevoidsetEstimatedSize(double size) voidsetFileName(String fileName) voidsetMimeType(String mimeType) voidSets the user who uploaded the resource, checked byUploadService.getUploadResource(String, String)andUploadService.removeUploadResource(String, String).voidsetStatus(int status) voidsetStoreLocation(String path)
-
Field Details
-
UPLOADING_STATUS
public static final int UPLOADING_STATUS- See Also:
-
UPLOADED_STATUS
public static final int UPLOADED_STATUS- See Also:
-
FAILED_STATUS
public static final int FAILED_STATUS- See Also:
-
-
Constructor Details
-
UploadResource
public UploadResource(String uploadId, String fileName, String mimeType, String storeLocation, double uploadedSize, double estimatedSize, int status) Builds a resource with all its upload attributes and no owner.- Parameters:
uploadId- upload idfileName- uploaded file namemimeType- uploaded file mime typestoreLocation- path of the stored fileuploadedSize- number of bytes receivedestimatedSize- expected number of bytesstatus- one ofUPLOADING_STATUS,UPLOADED_STATUS,FAILED_STATUS
-
UploadResource
-
UploadResource
-
-
Method Details
-
getUploadId
-
getFileName
-
setFileName
-
getMimeType
-
setMimeType
-
getStoreLocation
-
setStoreLocation
-
getUploadedSize
public double getUploadedSize() -
addUploadedBytes
public void addUploadedBytes(double size) -
getEstimatedSize
public double getEstimatedSize() -
setEstimatedSize
public void setEstimatedSize(double size) -
getStatus
public int getStatus() -
setStatus
public void setStatus(int status) -
getOwner
Returns the user who uploaded the resource: the authenticated user of the upload request, or the user an upload token was issued for.- Returns:
- the owner's username, or null when the resource was registered without one (an anonymous upload, or a server-side registration that did not set it)
-
setOwner
Sets the user who uploaded the resource, checked byUploadService.getUploadResource(String, String)andUploadService.removeUploadResource(String, String).- Parameters:
owner- the owner's username
-