java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.codelibs.jcifs.smb1.http.NetworkExplorer
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
public class NetworkExplorer
extends jakarta.servlet.http.HttpServlet
A servlet that provides network browsing capabilities for SMB shares using SMB1 protocol.
This servlet allows users to browse SMB network resources through a web interface.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompareDates(SmbFile f1, String f1name, SmbFile f2) Compares two SMB files by modification date.protected intcompareNames(SmbFile f1, String f1name, SmbFile f2) Compares two SMB files by name.protected intcompareSizes(SmbFile f1, String f1name, SmbFile f2) Compares two SMB files by size.protected intcompareTypes(SmbFile f1, String f1name, SmbFile f2) Compares two SMB files by file type/extension.protected voiddoDirectory(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, SmbFile dir) Handles directory listing requests for SMB directories.protected voiddoFile(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, SmbFile file) Handles file download requests for SMB files.voiddoGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) voidinit()Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
NetworkExplorer
public NetworkExplorer()Default constructor.
-
-
Method Details
-
init
public void init() throws jakarta.servlet.ServletException- Overrides:
initin classjakarta.servlet.GenericServlet- Throws:
jakarta.servlet.ServletException
-
doFile
protected void doFile(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, SmbFile file) throws IOException Handles file download requests for SMB files.- Parameters:
req- the HTTP servlet requestresp- the HTTP servlet responsefile- the SMB file to download- Throws:
IOException- if an I/O error occurs
-
compareNames
Compares two SMB files by name.- Parameters:
f1- first file to comparef1name- name of first filef2- second file to compare- Returns:
- comparison result for sorting
- Throws:
IOException- if an I/O error occurs
-
compareSizes
Compares two SMB files by size.- Parameters:
f1- first file to comparef1name- name of first filef2- second file to compare- Returns:
- comparison result for sorting
- Throws:
IOException- if an I/O error occurs
-
compareTypes
Compares two SMB files by file type/extension.- Parameters:
f1- first file to comparef1name- name of first filef2- second file to compare- Returns:
- comparison result for sorting
- Throws:
IOException- if an I/O error occurs
-
compareDates
Compares two SMB files by modification date.- Parameters:
f1- first file to comparef1name- name of first filef2- second file to compare- Returns:
- comparison result for sorting
- Throws:
IOException- if an I/O error occurs
-
doDirectory
protected void doDirectory(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, SmbFile dir) throws IOException Handles directory listing requests for SMB directories.- Parameters:
req- the HTTP servlet requestresp- the HTTP servlet responsedir- the SMB directory to list- Throws:
IOException- if an I/O error occurs
-
doGet
public void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException, jakarta.servlet.ServletException - Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
IOExceptionjakarta.servlet.ServletException
-