Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@ page import="org.apache.commons.net.ftp.FTPFile" %>
<%@ page import="jomm.web.ftp.IFile" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%
List<IFile> iFiles = (List<IFile>) request.getAttribute("files");
%>
<div class="files">
<ul>
<%
for(IFile i: iFiles)
{
if(i.isDirectory())
{
%>
<li><img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/folder.gif"><a href="<%=i.getName()%>/"><%=i.getName()%></a></li>
<%
}
}
%>
<%
for(IFile i: iFiles)
{
if(!i.isDirectory())
{
%>
<li>
<%
if(i.getName().endsWith("doc") || i.getName().endsWith("rtf"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/doc.gif">
<%
}
else if(i.getName().endsWith("pdf"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/pdf.gif">
<%
}
else if(i.getName().endsWith("ppt"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/ppt.gif">
<%
}
else if(i.getName().endsWith("zip") || i.getName().endsWith(".gz") || i.getName().endsWith("tgz"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/zip.gif">
<%
}
else if(i.getName().endsWith("rar"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/rar.gif">
<%
}
else if(i.getName().endsWith("txt"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/txt.gif">
<%
}
%>
<a href="<%=i.getCompleteUrl()%>"><%=i.getName()%></a>
</li>
<%
}
}
%>
</ul>
</div>