initial commit
This commit is contained in:
parent
5aeabf52d6
commit
5a6bd1d07b
148 changed files with 7509 additions and 0 deletions
107
WebRoot/fragments/fsim_bottom.jsp
Normal file
107
WebRoot/fragments/fsim_bottom.jsp
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<!-- START BOTTOM -->
|
||||
</div>
|
||||
<div id="bottomBar" class="bottomBar">
|
||||
<c:if test="${drawPageResults == true}">
|
||||
<div class="bottomBarPages">
|
||||
<c:forEach var="page" items="${searchBean.pages}">
|
||||
<a href="<c:url value="/search">
|
||||
<c:param name="m" value="0"/>
|
||||
<c:param name="p" value="${page}"/>
|
||||
<c:param name="q" value="${searchBean.searchQuery}"/>
|
||||
</c:url>"><c:out value="${page}"/></a>
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
<div class="bottomBarRender">
|
||||
<fmt:message key="fsim.bottombar.rendered" bundle="${fsim}"/>
|
||||
<c:out value="${renderTime}"/>
|
||||
<fmt:message key="fsim.bottombar.inms" bundle="${fsim}"/>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div id="bottom" class="bottom">
|
||||
<div class="bottomCopy">
|
||||
<br/>
|
||||
FSIM: Is a pluggable DataBae search engine.<br/>
|
||||
Very customizable. To fit all needs.<br/>
|
||||
<br/>
|
||||
<fmt:message key="fsim.copyright" bundle="${fsim}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="debug">
|
||||
</div>
|
||||
<div id="tech" class="tech">
|
||||
<a href="http://jigsaw.w3.org/css-validator/"
|
||||
title="<fmt:message key="fsim.tech.vcss.title" bundle="${fsim}"/>"
|
||||
>
|
||||
<img src="http://jigsaw.w3.org/css-validator/images/vcss"
|
||||
height="31"
|
||||
width="88"
|
||||
alt="<fmt:message key="fsim.tech.vcss.alt" bundle="${fsim}"/>"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<a href="http://validator.w3.org/check?uri=referer"
|
||||
title="<fmt:message key="fsim.tech.xhtml11.title" bundle="${fsim}"/>"
|
||||
>
|
||||
<img src="/images/tech/valid-xhtml11.png"
|
||||
height="31"
|
||||
width="88"
|
||||
alt="<fmt:message key="fsim.tech.xhtml11.alt" bundle="${fsim}"/>"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<a href="http://www.debian.org"
|
||||
title="<fmt:message key="fsim.tech.debian.title" bundle="${fsim}"/>"
|
||||
>
|
||||
<img src="/images/tech/debian.gif"
|
||||
alt="<fmt:message key="fsim.tech.debian.alt" bundle="${fsim}"/>"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<a href="http://sun.java.com"
|
||||
title="<fmt:message key="fsim.tech.java.title" bundle="${fsim}"/>"
|
||||
>
|
||||
<img src="/images/tech/duke.gif"
|
||||
height="60"
|
||||
width="60"
|
||||
alt="<fmt:message key="fsim.tech.java.alt" bundle="${fsim}"/>"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<a href="http://www.postgres.org"
|
||||
title="<fmt:message key="fsim.tech.postgres.title" bundle="${fsim}"/>"
|
||||
>
|
||||
<img src="/images/tech/postgres.gif"
|
||||
height="50"
|
||||
width="50"
|
||||
alt="<fmt:message key="fsim.tech.postgres.alt" bundle="${fsim}"/>"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<a href="http://www.kernel.org"
|
||||
title="<fmt:message key="fsim.tech.linux.title" bundle="${fsim}"/>"
|
||||
>
|
||||
<img src="/images/tech/tux.gif"
|
||||
height="60"
|
||||
width="60"
|
||||
alt="<fmt:message key="fsim.tech.linux.alt" bundle="${fsim}"/>"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<a href="http://jakarta.apache.org/tomcat/"
|
||||
title="<fmt:message key="fsim.tech.tomcat.title" bundle="${fsim}"/>"
|
||||
>
|
||||
<img src="/images/tech/tomcat.gif"
|
||||
height="50"
|
||||
width="60"
|
||||
alt="<fmt:message key="fsim.tech.tomcat.alt" bundle="${fsim}"/>"
|
||||
/>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
51
WebRoot/fragments/fsim_httphosts.jsp
Normal file
51
WebRoot/fragments/fsim_httphosts.jsp
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<div class="fsimHttpHosts">
|
||||
<br/>
|
||||
<form action="/admin" method="POST">
|
||||
IP: <input type="textfield" name="host_address"/>
|
||||
Reason: <input type="textfield" name="host_reason"/>
|
||||
<input type="submit" name="host_add" value="add"/>
|
||||
<input type="hidden" name="m" value="1"/>
|
||||
</form>
|
||||
<br/>
|
||||
<table border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>IP</td>
|
||||
<td>startDate</td>
|
||||
<td>lastMessage</td>
|
||||
<td>blocked</td>
|
||||
<td>blockedTime</td>
|
||||
<td>lastRequest</td>
|
||||
<td>permenent</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="host" items="${httpHosts}">
|
||||
<tr>
|
||||
<td><c:out value="${host.hostAddress}"/>
|
||||
<form action="/admin" method="POST">
|
||||
<input type="submit" name="host_monitoring_remove" value="remove"/>
|
||||
<input type="hidden" name="m" value="1"/>
|
||||
<input type="hidden" name="host_address" value="<c:out value="${host.hostAddress}"/>"/>
|
||||
</form>
|
||||
</td>
|
||||
<td><c:out value="${host.monitoredStartDate}"/></td>
|
||||
<td><c:out value="${host.lastMessage}"/></td>
|
||||
<td><c:out value="${host.blocked}"/></td>
|
||||
<td><c:out value="${host.blockedTime}"/></td>
|
||||
<td><c:out value="${host.lastRequest}"/></td>
|
||||
<td><c:out value="${host.permenent}"/>
|
||||
<form action="/admin" method="POST">
|
||||
<input type="submit" name="host_permanent_add" value="set permanent"/>
|
||||
<input type="submit" name="host_permanent_remove" value="remove permanent"/>
|
||||
<input type="hidden" name="m" value="1"/>
|
||||
<input type="hidden" name="host_address" value="<c:out value="${host.hostAddress}"/>"/>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
43
WebRoot/fragments/fsim_sessions.jsp
Normal file
43
WebRoot/fragments/fsim_sessions.jsp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.idca.fsim.web.session.SearchBean" %>
|
||||
<%@ page import="java.util.Enumeration" %>
|
||||
<div class="fsimSessions">
|
||||
<table border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="15%">SESSIONID</td>
|
||||
<td width="10%">created</td>
|
||||
<td width="10%">last access</td>
|
||||
<td>objects</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="session2" items="${sessions}">
|
||||
<tr>
|
||||
<td><c:out value="${session2.id}"/></td>
|
||||
<td><c:out value="${session2.creationTime}"/></td>
|
||||
<td><c:out value="${session2.lastAccessedTime}"/></td>
|
||||
<td>
|
||||
<%
|
||||
Enumeration sessionNames = session.getAttributeNames();
|
||||
while (sessionNames.hasMoreElements()) {
|
||||
String sessionName = (String)sessionNames.nextElement();
|
||||
String className = session.getAttribute( sessionName ).getClass().getName();
|
||||
out.println(sessionName+"("+className+")<br/>");
|
||||
|
||||
Object object = session.getAttribute(sessionName);
|
||||
if(object instanceof SearchBean)
|
||||
{
|
||||
SearchBean sb = (SearchBean)object;
|
||||
out.println("searched: "+sb.getSearchQuery()+"<br/>");
|
||||
}
|
||||
}
|
||||
|
||||
%>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
48
WebRoot/fragments/fsim_sources.jsp
Normal file
48
WebRoot/fragments/fsim_sources.jsp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<div class="fsimSessions">
|
||||
<table border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>table</td>
|
||||
<td>search column</td>
|
||||
<td>last index</td>
|
||||
<td>hits</td>
|
||||
<td>last id</id>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="source" items="${sources}">
|
||||
<tr>
|
||||
<td>
|
||||
<c:out value="${source.name}"/>
|
||||
<form action="/admin" method="POST">
|
||||
<input type="submit" name="source_index" value="index"/>
|
||||
<input type="hidden" name="m" value="2"/>
|
||||
<input type="hidden" name="source_name" value="<c:out value="${source.name}"/>"/>
|
||||
</form>
|
||||
</td>
|
||||
<td><c:out value="${source.tableName}"/></td>
|
||||
<td><c:out value="${source.searchColumnName}"/></td>
|
||||
<td><c:out value="${source.lastIndexed}"/></td>
|
||||
<td><c:out value="${source.hitsSize}"/></td>
|
||||
<td><c:out value="${source.lastIndexedHitID}"/></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
<br/>
|
||||
Update path cache:
|
||||
<form action="/admin" method="POST">
|
||||
<input type="submit" name="path_update" value="path_update"/>
|
||||
<input type="hidden" name="m" value="2"/>
|
||||
</form>
|
||||
<br/>
|
||||
Dump wordLists info in log.
|
||||
<form action="/admin" method="POST">
|
||||
<input type="submit" name="wordlists_info" value="wordlists info"/>
|
||||
<input type="hidden" name="m" value="2"/>
|
||||
</form>
|
||||
</div>
|
||||
137
WebRoot/fragments/fsim_top.jsp
Normal file
137
WebRoot/fragments/fsim_top.jsp
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<%@ 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.net.URLEncoder" %>
|
||||
<%@ page import="com.idca.fsim.core.plugins.SearchSource" %>
|
||||
<fmt:setBundle basename="com.idca.fsim.resources.i18n.fsim" var="fsim" scope="request"/>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title><fmt:message key="fsim.title" bundle="${fsim}"/></title>
|
||||
<script type="text/javascript"
|
||||
src="/js/fsim.js">
|
||||
</script>
|
||||
<link rel="stylesheet"
|
||||
type="text/css"
|
||||
href="/css/fsim-layout-default.css"
|
||||
media="all"
|
||||
/>
|
||||
<link rel="stylesheet"
|
||||
type="text/css"
|
||||
href="/css/fsim-style-default.css"
|
||||
media="screen"
|
||||
/>
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=UTF-8"
|
||||
/>
|
||||
<meta name="pagename"
|
||||
content="FSIM: File Search Index Machine"
|
||||
/>
|
||||
<meta name="description"
|
||||
content="File Search Indexing Machine"
|
||||
/>
|
||||
<meta name="keywords"
|
||||
content="fsim,idca,search,searching,file,files,directory,path,browse,ftp"
|
||||
/>
|
||||
<meta name="robots"
|
||||
content="all"
|
||||
/>
|
||||
<meta name="author"
|
||||
content="http://www.idca.nl"
|
||||
/>
|
||||
</head>
|
||||
<body onload="javascript:createAutoComplete();">
|
||||
<div id="top">
|
||||
<form action="/search" method="POST">
|
||||
<div id="topLogo" class="toplogo">
|
||||
<a href="/search"
|
||||
title="<fmt:message key="fsim.logo.title" bundle="${fsim}"/>"
|
||||
>
|
||||
<img src="images/fsim.png"
|
||||
alt="<fmt:message key="fsim.logo.alt" bundle="${fsim}"/>"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<c:if test="${drawSearch == true}">
|
||||
<div id="topSearchBox" class="topSearchBox">
|
||||
<div class="topSearchBoxTitle"><br/><fmt:message key="fsim.header.title" bundle="${fsim}"/></div>
|
||||
<div>
|
||||
<input name="q"
|
||||
id="q"
|
||||
size="35"
|
||||
autocomplete="off"
|
||||
type="text"
|
||||
value="<c:out value="${searchBean.searchQuery}"/>"/>
|
||||
|
||||
<input type="submit"
|
||||
value="<fmt:message key="fsim.search.button" bundle="${fsim}"/>"/>
|
||||
<div id="fsimKeywordsPopup"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topFsimLinks" class="topFsimLinks">
|
||||
<br/>
|
||||
Beta version.<br/>
|
||||
<%
|
||||
//<c:forEach var="source" items="${searchSources}">
|
||||
Collection ss = (Collection)request.getAttribute("searchSources2");
|
||||
Iterator i = ss.iterator();
|
||||
while(i.hasNext())
|
||||
{
|
||||
request.setAttribute("source",i.next());
|
||||
|
||||
%>
|
||||
<input type="checkbox"
|
||||
name="<c:out value="${source.name}"/>"
|
||||
onchange="this.form.submit();"
|
||||
<%
|
||||
String sss = (String)session.getAttribute("searchSources");
|
||||
SearchSource ss1 = (SearchSource)request.getAttribute("source");
|
||||
System.out.println("ssss: "+sss+" sdfsdf: " + ss1.getName());
|
||||
if(sss.contains(ss1.getName())) {
|
||||
out.print(" checked=\"true\" ");
|
||||
}
|
||||
|
||||
%>
|
||||
/>
|
||||
<c:out value="${source.name}"/>
|
||||
<br/>
|
||||
<%
|
||||
|
||||
}
|
||||
//</c:forEach>
|
||||
%>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<c:if test="${admin == true}">
|
||||
Welcome admin user
|
||||
<a href="/admin?m=0">sessions</a> <a href="/admin?m=1">host monitoring</a> <a href="/admin?m=2">sources</a>
|
||||
<br/>
|
||||
</c:if>
|
||||
|
||||
<div id="topBar" class="topBar">
|
||||
<c:if test="${drawPageResults == true}">
|
||||
<div class="bottomBarPages">
|
||||
<c:forEach var="page" items="${searchBean.pages}">
|
||||
<a href="<c:url value="/search">
|
||||
<c:param name="m" value="0"/>
|
||||
<c:param name="p" value="${page}"/>
|
||||
<c:param name="q" value="${searchBean.searchQuery}"/>
|
||||
</c:url>"><c:out value="${page}"/></a>
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
<div class="topBarSearchStats"><fmt:message key="fsim.topbar.results" bundle="${fsim}"/>
|
||||
<c:out value='${resultSize}'/> <fmt:message key="fsim.topbar.resultsin" bundle="${fsim}"/>
|
||||
<c:out value='${searchTime}'/> <fmt:message key="fsim.topbar.inms" bundle="${fsim}"/>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="results">
|
||||
<br/>
|
||||
<!-- END TOP -->
|
||||
4
WebRoot/fragments/searchers/files/file_mirrors.jsp
Normal file
4
WebRoot/fragments/searchers/files/file_mirrors.jsp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
|
||||
SEE MIRROR LIST
|
||||
24
WebRoot/fragments/searchers/files/file_redirect.jsp
Normal file
24
WebRoot/fragments/searchers/files/file_redirect.jsp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.idca.fsim.searchers.files.models.File" %>
|
||||
<%@ page import="com.idca.fsim.searchers.files.models.Path" %>
|
||||
<%@ page import="java.net.URLEncoder" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<%
|
||||
File file = (File)session.getAttribute("model");
|
||||
String url = file.getPath().getPath()+"/"+file.getName();
|
||||
url = file.getPath().getHost().getProtocol()+file.getPath().getHost().getHostName()+url;//URLEncoder.encode(url, "UTF-8");
|
||||
request.setAttribute("url",url);
|
||||
%>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<META http-equiv=Refresh Content="0;URL=<c:out value="${url}"/>"/>
|
||||
</head>
|
||||
<body>
|
||||
Going to path now.
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
39
WebRoot/fragments/searchers/files/host_browse.jsp
Normal file
39
WebRoot/fragments/searchers/files/host_browse.jsp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<%@ 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.Collection" %>
|
||||
<%@ page import="com.idca.fsim.searchers.files.models.Host" %>
|
||||
<%@ page import="com.idca.fsim.searchers.files.FilesListener" %>
|
||||
<%@ page import="com.idca.fsim.searchers.files.PathManager" %>
|
||||
<%
|
||||
Collection hosts = FilesListener.getPathManager().getHosts();
|
||||
request.setAttribute("hosts",hosts);
|
||||
%>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="host" items="${hosts}">
|
||||
<tr>
|
||||
<td>> <c:out value="${host.hostname}"/></td>
|
||||
<td>
|
||||
<span class="resultDetails">
|
||||
<%
|
||||
Host host = (Host)request.getAttribute("host");
|
||||
out.println(host.getRootPaths().size());
|
||||
%>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="resultDetails">
|
||||
<c:out value="${host.lastScanned}"/>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
19
WebRoot/fragments/searchers/files/host_redirect.jsp
Normal file
19
WebRoot/fragments/searchers/files/host_redirect.jsp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.idca.fsim.searchers.files.models.Host" %>
|
||||
<%@ page import="java.net.URLEncoder" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<%
|
||||
Host host = (Host)session.getAttribute("model");
|
||||
String url = host.getProtocol()+host.getHostName();
|
||||
//url = URLEncoder.encode(url, "UTF-8");
|
||||
request.setAttribute("url",url);
|
||||
%>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<META http-equiv=Refresh Content="0;URL=<c:out value="${url}"/>"/>
|
||||
</head>
|
||||
<body>
|
||||
Going to host now.
|
||||
</body>
|
||||
</html>
|
||||
150
WebRoot/fragments/searchers/files/path_browse.jsp
Normal file
150
WebRoot/fragments/searchers/files/path_browse.jsp
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
<%@ 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);
|
||||
%>
|
||||
<table width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="45%"></td>
|
||||
<td width="25%"></td>
|
||||
<td width="25%"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if (path!=null && path.getParent()!=null) { %>
|
||||
<tr>
|
||||
<td><span class="resultDetails"><a href="<%
|
||||
out.write("ppage?ss="+request.getParameter("ss")+"&rid="+path.getParent().getID()+"&up=path_browse");
|
||||
%>">..</a></span></td>
|
||||
<td><span class="resultDetails"></span></td>
|
||||
<td><span class="resultDetails"></span></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
|
||||
|
||||
|
||||
|
||||
<% if (host!=null) {
|
||||
%>
|
||||
<tr>
|
||||
<td><span class="resultDetails">/</span></td>
|
||||
<td><span class="resultDetails">(root)</span></td>
|
||||
<td><span class="resultDetails"></span></td>
|
||||
</tr>
|
||||
<% }
|
||||
|
||||
//<c:forEach var="path" items="${paths}">
|
||||
Iterator p = paths.iterator();
|
||||
while(p.hasNext())
|
||||
{
|
||||
Path pp = (Path)p.next();
|
||||
request.setAttribute("path",pp);
|
||||
%>
|
||||
<tr>
|
||||
<td>> <a href="<c:out value="${path.path}"/>"><c:out value="${path.path}"/></a></td>
|
||||
<td>
|
||||
<span class="resultDetails">
|
||||
<%
|
||||
Path path2 = (Path)request.getAttribute("path");
|
||||
//if(path2!=null) {
|
||||
out.println(path2.getChilderen().size());
|
||||
//} else {
|
||||
// out.println("path2 null");
|
||||
//}
|
||||
|
||||
|
||||
%>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="resultDetails">
|
||||
<c:out value="${path.host.lastScanned}"/>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<% }
|
||||
|
||||
//</c:forEach
|
||||
//<c:forEach var="file" items="${files}">
|
||||
Iterator f = files.iterator();
|
||||
while(f.hasNext())
|
||||
{
|
||||
request.setAttribute("file",f.next());
|
||||
File file = (File)request.getAttribute("file");
|
||||
|
||||
|
||||
//redirect?ss="+hit.source.getName()+"&rid="+hit.id+"&up=path_browse"+"\">browse");
|
||||
|
||||
String url = "redirect/"+file.getPath()+file.getName();
|
||||
|
||||
url = file.getPath().getHost().getProtocol()+file.getPath().getHost().getHostName()+URLEncoder.encode(url, "UTF-8");
|
||||
|
||||
%>
|
||||
<tr>
|
||||
<td><span class="resultDetails"><a href="<%=url%>"><c:out value="${file.name}"/></a></span></td>
|
||||
<td><span class="resultDetails">
|
||||
<%
|
||||
//File file = (File)request.getAttribute("file");
|
||||
//if(file!=null) {
|
||||
out.println(File.printSize(file));
|
||||
//} else {
|
||||
// out.println("file is null");
|
||||
//}
|
||||
%>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="resultDetails">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
//</c:forEach>
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
22
WebRoot/fragments/searchers/files/path_redirect.jsp
Normal file
22
WebRoot/fragments/searchers/files/path_redirect.jsp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.idca.fsim.searchers.files.models.File" %>
|
||||
<%@ page import="com.idca.fsim.searchers.files.models.Path" %>
|
||||
<%@ page import="java.net.URLEncoder" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<%
|
||||
Path path = (Path)session.getAttribute("model");
|
||||
String url = path.getPath();
|
||||
//url = URLEncoder.encode(url, "UTF-8");
|
||||
request.setAttribute("url",path.getHost().getProtocol()+path.getHost().getHostName()+url);
|
||||
//<jsp:useBean id="hit" class="com.idca.fsim.models.Hit" scope="session"/>
|
||||
//<jsp:useBean id="model" class="com.idca.fsim.searchers.files.models.Path" scope="session"/>
|
||||
%>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<META http-equiv=Refresh Content="0;URL=<c:out value="${url}"/>"/>
|
||||
</head>
|
||||
<body>
|
||||
Downloading file now.
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue