Merged HEAD (5.2) to 5.2.N (5.2.1)

126489 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      122631 jkaabimofrad: RA-676: Added node's renditions REST API.
              - Download renditioned content + test


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126833 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-05-11 11:43:54 +00:00
parent b5a0388b74
commit f053fca565
10 changed files with 362 additions and 40 deletions

View File

@@ -0,0 +1,40 @@
/*
* Copyright (C) 2005-2016 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.rest.framework.resource.content;
/**
* An abstract binary resource.
*
* @author Jamal Kaabi-Mofrad
*/
public class AbstractBinaryResource implements BinaryResource
{
final String attachFileName;
public AbstractBinaryResource(String attachFileName)
{
this.attachFileName = attachFileName;
}
public String getAttachFileName()
{
return attachFileName;
}
}

View File

@@ -30,16 +30,21 @@ import java.io.File;
/**
* A binary resource based on a File.
*
*
* @author Gethin James
*/
public class FileBinaryResource implements BinaryResource
public class FileBinaryResource extends AbstractBinaryResource
{
final File file;
public FileBinaryResource(File file)
{
super();
this(file, null);
}
public FileBinaryResource(File file, String attachFileName)
{
super(attachFileName);
this.file = file;
}

View File

@@ -30,25 +30,22 @@ import org.alfresco.service.namespace.QName;
/**
* A binary resource based on a Node reference.
*
*
* @author Gethin James
*/
public class NodeBinaryResource implements BinaryResource
public class NodeBinaryResource extends AbstractBinaryResource
{
final NodeRef nodeRef;
final QName propertyQName;
final ContentInfo contentInfo;
final String attachFileName;
public NodeBinaryResource(NodeRef nodeRef, QName propertyQName, ContentInfo contentInfo, String attachFileName)
{
super();
super(attachFileName);
this.nodeRef = nodeRef;
this.propertyQName = propertyQName;
this.contentInfo = contentInfo;
this.attachFileName = attachFileName;
}
public NodeRef getNodeRef()
@@ -65,9 +62,4 @@ public class NodeBinaryResource implements BinaryResource
{
return this.contentInfo;
}
public String getAttachFileName()
{
return this.attachFileName;
}
}
}