mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
119798 jvonka: FileFolder API - NodeApiTest - add tests (+ve & -ve) to create empty file node - TODO subsequently show that file content can be updated RA-636 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@126369 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,6 +29,10 @@ public class ContentInfo
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
public void setMimeType(String mimeType) {
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
public String getMimeTypeName() {
|
||||
return mimeTypeName;
|
||||
}
|
||||
|
@@ -39,8 +39,6 @@ import org.alfresco.service.namespace.QName;
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class Document extends Node
|
||||
{
|
||||
private ContentInfo contentInfo;
|
||||
|
||||
public Document() {
|
||||
super();
|
||||
}
|
||||
@@ -55,22 +53,12 @@ public class Document extends Node
|
||||
ContentData cd = (ContentData)val;
|
||||
String mimeType = cd.getMimetype();
|
||||
String mimeTypeName = sr.getMimetypeService().getDisplaysByMimetype().get(mimeType);
|
||||
this.contentInfo = new ContentInfo(mimeType, mimeTypeName, cd.getSize(), cd.getEncoding());
|
||||
contentInfo = new ContentInfo(mimeType, mimeTypeName, cd.getSize(), cd.getEncoding());
|
||||
}
|
||||
|
||||
this.isFolder = false;
|
||||
}
|
||||
|
||||
public ContentInfo getContent()
|
||||
{
|
||||
return contentInfo;
|
||||
}
|
||||
|
||||
public void setContent(ContentInfo contentInfo)
|
||||
{
|
||||
this.contentInfo = contentInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
@@ -47,6 +47,12 @@ public class Folder extends Node
|
||||
this.isFolder = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContentInfo getContent()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
@@ -292,6 +292,19 @@ public class Node implements Comparable<Node>
|
||||
+ modifiedByUser + ", pathInfo =" + pathInfo +"]";
|
||||
}
|
||||
|
||||
protected ContentInfo contentInfo;
|
||||
|
||||
public ContentInfo getContent()
|
||||
{
|
||||
return contentInfo;
|
||||
}
|
||||
|
||||
public void setContent(ContentInfo contentInfo)
|
||||
{
|
||||
this.contentInfo = contentInfo;
|
||||
}
|
||||
|
||||
|
||||
// TODO for backwards compat' - set explicitly when needed (ie. favourites) (note: we could choose to have separate old Node/NodeImpl etc)
|
||||
|
||||
protected String title;
|
||||
|
Reference in New Issue
Block a user