public class Asset extends Object implements Serializable
| Constructor and Description |
|---|
Asset(Sandbox sandbox,
AssetInfo asset) |
| Modifier and Type | Method and Description |
|---|---|
void |
createFile(String name,
String stringContent)
create a new file with the specified properties and content.
|
void |
createFolder(String name)
create a new folder
|
void |
deleteAsset()
Delete this asset, after it has been deleted do not use this asset.
|
Asset[] |
getChildren()
Get children of this asset, returns an empty array if there are no children.
|
String |
getContent()
Returns textual representation of the Asset content
|
Date |
getCreatedDate() |
String |
getCreatedDateAsISO8601() |
String |
getCreator()
The creator of this asset
|
long |
getFileSize() |
Date |
getModifiedDate() |
String |
getModifiedDateAsISO8601() |
String |
getModifier() |
String |
getName() |
String |
getPath()
Get the full path of this asset eg.
|
Map<String,String> |
getProperties()
Get the properties as a key value pair.
|
Sandbox |
getSandbox()
Get the parent sandbox which contains this asset
|
int |
getVersion() |
boolean |
isDeleted() |
boolean |
isFile() |
boolean |
isFolder() |
boolean |
isLocked() |
String |
lockOwner() |
Asset |
move(String newPath)
move this asset
|
Asset |
rename(String newName)
rename this asset
|
void |
revert()
revert this asset
|
void |
save()
Save the properties please note some system properties are protected and cannot be updated.
|
void |
setProperties(Object nativeProperties) |
void |
submit(String submitLabel,
String submitComment)
Submit this asset to staging
|
boolean |
writeContent(org.springframework.extensions.surf.util.Content content)
Updates a content of the current Asset
|
boolean |
writeContent(String content)
Updates a content of a current Asset
|
public String getCreator()
public Date getCreatedDate()
public long getFileSize()
public String getCreatedDateAsISO8601()
public String getModifier()
public Date getModifiedDate()
public String getModifiedDateAsISO8601()
public String getName()
public String getPath()
public boolean isFile()
public boolean isFolder()
public boolean isDeleted()
public boolean isLocked()
public String lockOwner()
public int getVersion()
public Map<String,String> getProperties()
public void save()
properties - public void setProperties(Object nativeProperties) throws org.json.JSONException
properties - org.json.JSONExceptionpublic boolean writeContent(String content)
content - String value which represents new textual contenttrue if a content has been set without errorspublic boolean writeContent(org.springframework.extensions.surf.util.Content content)
content - a Content value which represents new contenttrue if a content has been set without errorspublic String getContent() throws org.alfresco.service.cmr.repository.ContentIOException, IOException
org.alfresco.service.cmr.repository.ContentIOExceptionIOExceptionpublic void submit(String submitLabel, String submitComment)
submitLabel - submitComment - public void deleteAsset()
public void revert()
public Asset[] getChildren()
public void createFile(String name, String stringContent)
name - the name of the filestringContent - the content of the file. Can be null.public void createFolder(String name)
name - the name of the new folderpublic Sandbox getSandbox()
Copyright © 2005–2014 Alfresco Software. All rights reserved.