ikrs.httpd.filehandler
Class PHPDirectoryResource
java.lang.Object
ikrs.httpd.resource.AbstractResource
ikrs.httpd.resource.AbstractDirectoryResource
ikrs.httpd.filehandler.PHPDirectoryResource
- All Implemented Interfaces:
- Resource, DirectoryResource
Deprecated.
public class PHPDirectoryResource
- extends AbstractDirectoryResource
This class is DEPRECATED and should not be used any more (security issues).
This class is a mixture of ikrs.http.resource.DirectoryResource and ikrs.http.FileHandler.
Due to security reasons it is not recommended to use this class any more:
(i) You do not know what PHP code will really be executed ... system wide!
(ii) A custom directory listing implementation might show htacess or htpasswd or any
other sensitive data the the users (world wide!).
And one more reason: PHP is not necesarily installed on all target systems.
Method Summary |
void |
generateDirectoryListing(java.util.UUID sid,
java.io.OutputStream out)
Deprecated. This method is designated to build the data for the directory listing. |
MIMEType |
getDirectoryListingType()
Deprecated. This method returns the Content-Type this class generates. |
Methods inherited from class ikrs.httpd.resource.AbstractDirectoryResource |
close, getDateFormat, getDirectoryFile, getFileFilter, getInputStream, getLength, getOutputStream, getRequestURI, isOpen, isReadOnly, open |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PHPDirectoryResource
public PHPDirectoryResource(HTTPHandler handler,
CustomLogger logger,
HTTPFileFilter fileFilter,
java.io.File dir,
java.net.URI requestURI,
java.util.UUID sid,
java.lang.String format,
boolean useFairLocks)
throws java.lang.NullPointerException
- Deprecated.
- Create a new DefaultDirectoryResource.
- Parameters:
logger
- A custom logger to write log messages to.fileFilter
- The file filter to use.dir
- The directory.requestURI
- The uri from the request (will be used to avoid printing the absolute file path).format
- The output format; currently "TXT" and "HTML" are supported (default is "TXT", if format is null).useFairLocks
- If set to true the created resource will use fair locks.
- Throws:
java.lang.NullPointerException
generateDirectoryListing
public void generateDirectoryListing(java.util.UUID sid,
java.io.OutputStream out)
throws java.io.IOException
- Deprecated.
- This method is designated to build the data for the directory listing.
Subclasses must implement this method and write the generated data into the given output stream.
- Specified by:
generateDirectoryListing
in interface DirectoryResource
- Specified by:
generateDirectoryListing
in class AbstractDirectoryResource
- Parameters:
sid
- The current session's ID.out
- The output stream to write the list data to.
- Throws:
java.io.IOException
- If any IO errors occur.
getDirectoryListingType
public MIMEType getDirectoryListingType()
- Deprecated.
- This method returns the Content-Type this class generates.
The returned MIME type must not be null.
- Specified by:
getDirectoryListingType
in interface DirectoryResource
- Specified by:
getDirectoryListingType
in class AbstractDirectoryResource
- Returns:
- The Content-Type this class generates.