%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ page import="java.util.List" %> <%@ page import="java.util.Collection" %> <%@ page import="java.util.Iterator" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.net.URLEncoder" %> <%@ page import="com.idca.fsim.searchers.files.models.Host" %> <%@ page import="com.idca.fsim.searchers.files.models.File" %> <%@ page import="com.idca.fsim.searchers.files.models.Path" %> <%@ page import="com.idca.fsim.searchers.files.FilesListener" %> <% Object model = session.getAttribute("model"); Path path = null; Host host = null; Collection paths = null; List files = null; if(model instanceof File) { File file = (File)model; path = file.getPath(); paths = path.getChilderen(); files = FilesListener.getPathManager().getFiles(path); } if(model instanceof Path) { path = (Path)model; paths = path.getChilderen(); files = FilesListener.getPathManager().getFiles(path); } if(model instanceof Host) { host = (Host)model; if (host.getRootPaths().iterator().hasNext()) { paths = ((Path)(host.getRootPaths().iterator().next())).getChilderen(); files = FilesListener.getPathManager().getFiles(((Path)(host.getRootPaths().iterator().next()))); } else { paths = new ArrayList(); files = new ArrayList(); } } request.setAttribute("paths",paths); request.setAttribute("files",files); %>
">.. | ||
/ | (root) | |
> "> |
<% Path path2 = (Path)request.getAttribute("path"); //if(path2!=null) { out.println(path2.getChilderen().size()); //} else { // out.println("path2 null"); //} %> |
|
<% //File file = (File)request.getAttribute("file"); //if(file!=null) { out.println(File.printSize(file)); //} else { // out.println("file is null"); //} %> |