Module jcifs

Class NetworkExplorer

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
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
    compareDates(SmbFile f1, String f1name, SmbFile f2)
    Compares two SMB files by modification date.
    protected int
    compareNames(SmbFile f1, String f1name, SmbFile f2)
    Compares two SMB files by name.
    protected int
    compareSizes(SmbFile f1, String f1name, SmbFile f2)
    Compares two SMB files by size.
    protected int
    compareTypes(SmbFile f1, String f1name, SmbFile f2)
    Compares two SMB files by file type/extension.
    protected void
    doDirectory(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, SmbFile dir)
    Handles directory listing requests for SMB directories.
    protected void
    doFile(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, SmbFile file)
    Handles file download requests for SMB files.
    void
    doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     
    void
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NetworkExplorer

      public NetworkExplorer()
      Default constructor.
  • Method Details

    • init

      public void init() throws jakarta.servlet.ServletException
      Overrides:
      init in class jakarta.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 request
      resp - the HTTP servlet response
      file - the SMB file to download
      Throws:
      IOException - if an I/O error occurs
    • compareNames

      protected int compareNames(SmbFile f1, String f1name, SmbFile f2) throws IOException
      Compares two SMB files by name.
      Parameters:
      f1 - first file to compare
      f1name - name of first file
      f2 - second file to compare
      Returns:
      comparison result for sorting
      Throws:
      IOException - if an I/O error occurs
    • compareSizes

      protected int compareSizes(SmbFile f1, String f1name, SmbFile f2) throws IOException
      Compares two SMB files by size.
      Parameters:
      f1 - first file to compare
      f1name - name of first file
      f2 - second file to compare
      Returns:
      comparison result for sorting
      Throws:
      IOException - if an I/O error occurs
    • compareTypes

      protected int compareTypes(SmbFile f1, String f1name, SmbFile f2) throws IOException
      Compares two SMB files by file type/extension.
      Parameters:
      f1 - first file to compare
      f1name - name of first file
      f2 - second file to compare
      Returns:
      comparison result for sorting
      Throws:
      IOException - if an I/O error occurs
    • compareDates

      protected int compareDates(SmbFile f1, String f1name, SmbFile f2) throws IOException
      Compares two SMB files by modification date.
      Parameters:
      f1 - first file to compare
      f1name - name of first file
      f2 - 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 request
      resp - the HTTP servlet response
      dir - 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:
      doGet in class jakarta.servlet.http.HttpServlet
      Throws:
      IOException
      jakarta.servlet.ServletException