| Package | Description |
|---|---|
| org.owasp.fileio |
| Modifier and Type | Method and Description |
|---|---|
void |
FileValidator.assertValidFileUpload(String context,
String directorypath,
String filename,
File parent,
byte[] content,
int maxBytes,
List<String> allowedExtensions,
boolean allowNull,
List<ValidationException> errors)
Calls getValidFileUpload with the supplied List to capture ValidationExceptions
|
String |
FileValidator.getValidDirectoryPath(String context,
String input,
File parent,
boolean allowNull,
List<ValidationException> errors)
Calls getValidDirectoryPath with the supplied error List to capture ValidationExceptions
|
byte[] |
FileValidator.getValidFileContent(String context,
byte[] input,
int maxBytes,
boolean allowNull,
List<ValidationException> errors)
Calls getValidFileContent with the supplied List to capture ValidationExceptions
|
String |
FileValidator.getValidFileName(String context,
String input,
List<String> allowedExtensions,
boolean allowNull,
List<ValidationException> errors)
Calls getValidFileName with the supplied List to capture ValidationExceptions
|
boolean |
FileValidator.isValidDirectoryPath(String context,
String input,
File parent,
boolean allowNull,
List<ValidationException> errors)
Calls getValidDirectoryPath and returns true if no exceptions are thrown.
|
boolean |
FileValidator.isValidFileContent(String context,
byte[] input,
int maxBytes,
boolean allowNull,
List<ValidationException> errors)
Calls getValidFileContent and returns true if no exceptions are thrown.
|
boolean |
FileValidator.isValidFileName(String context,
String input,
boolean allowNull,
List<ValidationException> errors)
Calls getValidFileName with the default list of allowedExtensions
|
boolean |
FileValidator.isValidFileName(String context,
String input,
List<String> allowedExtensions,
boolean allowNull,
List<ValidationException> errors)
Calls getValidFileName with the default list of allowedExtensions
|
boolean |
FileValidator.isValidFileUpload(String context,
String directorypath,
String filename,
File parent,
byte[] content,
int maxBytes,
boolean allowNull,
List<ValidationException> errors)
Calls getValidFileUpload and returns true if no exceptions are thrown.
|
| Modifier and Type | Method and Description |
|---|---|
void |
FileValidator.assertValidFileUpload(String context,
String directorypath,
String filename,
File parent,
byte[] content,
int maxBytes,
List<String> allowedExtensions,
boolean allowNull)
Validates the filepath, filename, and content of a file.
|
String |
StringValidationRule.getValid(String context,
String input) |
String |
FileValidator.getValidDirectoryPath(String context,
String input,
File parent,
boolean allowNull)
Returns a canonicalized and validated directory path as a String, provided that the input maps to an existing directory that is an existing subdirectory (at any level) of the specified parent.
|
byte[] |
FileValidator.getValidFileContent(String context,
byte[] input,
boolean allowNull)
Returns validated file content as a byte array.
|
byte[] |
FileValidator.getValidFileContent(String context,
byte[] input,
int maxBytes,
boolean allowNull,
List<ValidationException> errors)
Calls getValidFileContent with the supplied List to capture ValidationExceptions
|
byte[] |
FileValidator.getValidFileContent(String context,
byte[] input,
long maxBytes,
boolean allowNull)
Returns validated file content as a byte array.
|
String |
FileValidator.getValidFileName(String context,
String input,
List<String> allowedExtensions,
boolean allowNull)
Returns a canonicalized and validated file name as a String.
|
String |
FileValidator.getValidInput(String context,
String input,
String type,
int maxLength,
boolean allowNull)
Validates data received from the browser and returns a safe version.
|
String |
FileValidator.getValidInput(String context,
String input,
String type,
int maxLength,
boolean allowNull,
boolean canonicalize)
Validates data received from the browser and returns a safe version.
|
boolean |
FileValidator.isValidFileUpload(String context,
String directorypath,
String filename,
File parent,
byte[] content,
int maxBytes,
boolean allowNull)
Calls getValidFileUpload and returns true if no exceptions are thrown.
|
| Constructor and Description |
|---|
SafeFile(File parent,
String child) |
SafeFile(String path) |
SafeFile(String parent,
String child) |
SafeFile(URI uri) |
Copyright © 2017. All rights reserved.