mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Publishing: Corrected (or created) Javadoc comments for classes
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30819 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,6 +24,7 @@ import java.io.InputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.alfresco.repo.content.MimetypeMap;
|
||||||
import org.alfresco.service.cmr.publishing.channels.ChannelService;
|
import org.alfresco.service.cmr.publishing.channels.ChannelService;
|
||||||
import org.alfresco.service.cmr.publishing.channels.ChannelType;
|
import org.alfresco.service.cmr.publishing.channels.ChannelType;
|
||||||
import org.alfresco.service.cmr.repository.MimetypeService;
|
import org.alfresco.service.cmr.repository.MimetypeService;
|
||||||
@@ -82,7 +83,14 @@ public class ChannelTypeIconGetWebScript extends AbstractWebScript
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.setHeader("Content-Length", "" + iconFile.contentLength());
|
res.setHeader("Content-Length", "" + iconFile.contentLength());
|
||||||
String mimeType = mimetypeService.getMimetype(channelType.getIconFileExtension());
|
String filename = iconFile.getFilename();
|
||||||
|
int lastDot = filename.lastIndexOf('.');
|
||||||
|
String ext = MimetypeMap.EXTENSION_BINARY;
|
||||||
|
if (lastDot != -1 && lastDot < (filename.length()-1))
|
||||||
|
{
|
||||||
|
ext = filename.substring(lastDot);
|
||||||
|
}
|
||||||
|
String mimeType = mimetypeService.getMimetype(ext);
|
||||||
res.setContentType(mimeType);
|
res.setContentType(mimeType);
|
||||||
OutputStream out = res.getOutputStream();
|
OutputStream out = res.getOutputStream();
|
||||||
InputStream in = iconFile.getInputStream();
|
InputStream in = iconFile.getInputStream();
|
||||||
|
Reference in New Issue
Block a user