initial-content.libs.nt.file.edit.jsp Maven / Gradle / Ivy
<%--
/************************************************************************
** $Date: $
** $Source: $
** $Author: $
** $Revision: $
************************************************************************/
--%><%
%><%@page session="false" contentType="text/html; charset=utf-8" %><%
%><%@page import="java.io.*,
java.net.*,
javax.jcr.*,
org.apache.sling.api.resource.*,
utils.*"
%><%
%><%@ taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><%!
%><%
%> <%
String type = "unknown";
if (currentNode.hasProperty("jcr:content/jcr:mimeType")) {
String path = currentNode.getPath();
String mimetype = currentNode.getProperty("jcr:content/jcr:mimeType").getString();
if (mimetype.equalsIgnoreCase("plain/text")) type = "text";
else if (mimetype.equalsIgnoreCase("text/plain")) type = "text";
else if (mimetype.equalsIgnoreCase("text/html")) type = "text";
else if (path.endsWith(".jsp")) type = "text";
else if (path.endsWith(".html"))type = "text";
else if (path.endsWith(".css")) type = "text";
else if (path.endsWith(".js")) type = "text";
else if (path.endsWith(".png")) type = "image";
}
%>
<% } else if ("image".equalsIgnoreCase(type)) { %>
<% } else { %>
<% } %>
<% if ("text".equalsIgnoreCase(type)) { %>