java.lang.Object
de.s42.base.files.FilesHelper
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate static final jakarta.activation.MimetypesFileTypeMap -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic final voidstatic final voidstatic final StringcreateMavenNetbeansFileConsoleLink(String message, String fileShort, String file, int line, int column) static final StringcreateMavenNetbeansFileConsoleLink(String message, String fileShort, String file, int line, int column, boolean sanitize) See https://github.com/apache/netbeans/blob/c084119009d2e0f736f225d706bc1827af283501/java/maven/src/org/netbeans/modules/maven/output/GlobalOutputProcessor.java Line 71 and 174 From https://maven.apache.org/ref/3.0.5/maven-model-builder/ From https://maven.apache.org/ref/3.0.5/maven-model-builder/apidocs/org/apache/maven/model/building/ModelProblemUtils.html#formatLocation(org.apache.maven.model.building.ModelProblem,%20java.lang.String)static final StringcreateMavenNetbeansFileConsoleLink(String message, Path file) static final Stringstatic final booleandirectoryExists(String path) static final booleandirectoryExists(Path path) static final voidemptyDirectory(String path) static final voidemptyDirectory(Path path) static final booleanfileExists(String path) static final booleanfileExists(Path path) static final StringgetExtension(String path) static final StringgetExtension(Path path) static ByteBuffergetFileAsByteBuffer(String fileName) static ByteBuffergetFileAsByteBuffer(Path filePath) static BufferedImagegetFileAsImage(Path file) static final org.json.JSONObjectgetFileAsJSON(String path) static final org.json.JSONObjectgetFileAsJSON(Path path) static MappedByteBuffergetFileAsMappedByteBuffer(String fileName) static MappedByteBuffergetFileAsMappedByteBuffer(Path filePath) static BufferedImagegetFileAsScaledImage(Path file, int width, int height) static final StringgetFileAsString(String path) static final StringgetFileAsString(Path path) static StringgetFileMD5(String path) static StringgetFileMD5(Path path) static StringgetFileSHA256(String path) static StringgetFileSHA256(Path path) static final StringgetMimeType(Path file) static Pathstatic Pathstatic final byte[]getZippedSingleFileAsByteArray(String fileName) static final byte[]getZippedSingleFileAsByteArray(Path filePath) static final StringgetZippedSingleFileAsString(String fileName) static final StringgetZippedSingleFileAsString(Path filePath) static final voidstatic final voidstatic Pathstatic final StringsanitizeFileName(String name) static voidsaveImageAsFileJpg(BufferedImage image, String outputFile, float quality) static voidsaveImageAsFileJpg(BufferedImage image, Path outputFile, float quality) static voidsaveImageAsFilePng(BufferedImage image, String outputFile) static voidsaveImageAsFilePng(BufferedImage image, Path outputFile) static final voidwriteByteArrayToFile(String path, byte[] content) static final voidwriteByteArrayToFile(Path path, byte[] content) static final voidwriteStringToFile(String path, String content) static final voidwriteStringToFile(Path path, String content)
-
Felddetails
-
fileTypeMap
private static final jakarta.activation.MimetypesFileTypeMap fileTypeMap
-
-
Konstruktordetails
-
FilesHelper
private FilesHelper()
-
-
Methodendetails
-
getMimeType
- Löst aus:
IOException
-
createMavenNetbeansFileConsoleLink
-
createMavenNetbeansFileConsoleLink
-
createMavenNetbeansFileConsoleLink
-
createMavenNetbeansFileConsoleLink
public static final String createMavenNetbeansFileConsoleLink(String message, String fileShort, String file, int line, int column, boolean sanitize) See https://github.com/apache/netbeans/blob/c084119009d2e0f736f225d706bc1827af283501/java/maven/src/org/netbeans/modules/maven/output/GlobalOutputProcessor.java Line 71 and 174 From https://maven.apache.org/ref/3.0.5/maven-model-builder/ From https://maven.apache.org/ref/3.0.5/maven-model-builder/apidocs/org/apache/maven/model/building/ModelProblemUtils.html#formatLocation(org.apache.maven.model.building.ModelProblem,%20java.lang.String)- Parameter:
message- human readyble message of this infofileShort- short name of file without pathfile- complete name of file with absolute pathline- has to be 1 or highercolumn- has to be 1 or highersanitize- default is false - if true it ensures empty messages get sanitized to match the pattern- Gibt zurück:
- the prepared string which can be print to console
-
getExtension
-
getExtension
-
sanitizeFileName
-
fileExists
-
fileExists
-
directoryExists
-
directoryExists
-
getFileMD5
- Löst aus:
IOExceptionNoSuchAlgorithmException
-
getFileMD5
- Löst aus:
IOExceptionNoSuchAlgorithmException
-
getFileSHA256
- Löst aus:
IOExceptionNoSuchAlgorithmException
-
getFileSHA256
- Löst aus:
IOExceptionNoSuchAlgorithmException
-
getFileAsJSON
public static final org.json.JSONObject getFileAsJSON(String path) throws IOException, org.json.JSONException - Löst aus:
IOExceptionorg.json.JSONException
-
getFileAsJSON
public static final org.json.JSONObject getFileAsJSON(Path path) throws IOException, org.json.JSONException - Löst aus:
IOExceptionorg.json.JSONException
-
getFileAsString
- Löst aus:
IOException
-
getFileAsString
- Löst aus:
IOException
-
writeStringToFile
- Löst aus:
IOException
-
writeStringToFile
- Löst aus:
IOException
-
writeByteArrayToFile
- Löst aus:
IOException
-
writeByteArrayToFile
- Löst aus:
IOException
-
moveFile
public static final void moveFile(String sourcePath, String targetPath, boolean createDirectories, boolean overwrite) throws IOException - Löst aus:
IOException
-
moveFile
public static final void moveFile(Path sourcePath, Path targetPath, boolean createDirectories, boolean overwrite) throws IOException - Löst aus:
IOException
-
copyFile
public static final void copyFile(String sourcePath, String targetPath, boolean createDirectories, boolean overwrite) throws IOException - Löst aus:
IOException
-
copyFile
public static final void copyFile(Path sourcePath, Path targetPath, boolean createDirectories, boolean overwrite) throws IOException - Löst aus:
IOException
-
emptyDirectory
- Löst aus:
IOException
-
emptyDirectory
- Löst aus:
IOException
-
getUserHome
-
getWorkingDirectory
-
pathOf
-
getFileAsByteBuffer
- Löst aus:
IOException
-
getFileAsByteBuffer
- Löst aus:
IOException
-
getFileAsMappedByteBuffer
- Löst aus:
IOException
-
getFileAsMappedByteBuffer
- Löst aus:
IOException
-
getZippedSingleFileAsString
- Löst aus:
IOException
-
getZippedSingleFileAsString
- Löst aus:
IOException
-
getZippedSingleFileAsByteArray
- Löst aus:
IOException
-
getZippedSingleFileAsByteArray
- Löst aus:
IOException
-
saveImageAsFilePng
- Löst aus:
IOException
-
saveImageAsFilePng
- Löst aus:
IOException
-
saveImageAsFileJpg
public static void saveImageAsFileJpg(BufferedImage image, String outputFile, float quality) throws IOException - Löst aus:
IOException
-
saveImageAsFileJpg
public static void saveImageAsFileJpg(BufferedImage image, Path outputFile, float quality) throws IOException - Löst aus:
IOException
-
getFileAsScaledImage
-
getFileAsImage
-