3
Fork 0

initial commit

This commit is contained in:
Willem Cazander 2022-11-13 14:46:54 +01:00
parent 5aeabf52d6
commit 5a6bd1d07b
148 changed files with 7509 additions and 0 deletions

View 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

View 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>

View 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>&gt; <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>

View 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>

View 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>&gt; <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>

View 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>