java.lang.Object
de.s42.base.files.FilesHelper
-
Feldübersicht
Modifizierer und TypFeldBeschreibungprivate static final jakarta.activation.MimetypesFileTypeMap
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic final void
static final void
static final String
createMavenNetbeansFileConsoleLink
(String message, String fileShort, String file, int line, int column) 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)static final String
createMavenNetbeansFileConsoleLink
(String message, Path file) static final String
static final boolean
directoryExists
(String path) static final boolean
directoryExists
(Path path) static final void
emptyDirectory
(String path) static final void
emptyDirectory
(Path path) static final boolean
fileExists
(String path) static final boolean
fileExists
(Path path) static final String
getExtension
(String path) static final String
getExtension
(Path path) static ByteBuffer
getFileAsByteBuffer
(String fileName) static ByteBuffer
getFileAsByteBuffer
(Path filePath) static BufferedImage
getFileAsImage
(Path file) static final org.json.JSONObject
getFileAsJSON
(String path) static final org.json.JSONObject
getFileAsJSON
(Path path) static MappedByteBuffer
getFileAsMappedByteBuffer
(String fileName) static MappedByteBuffer
getFileAsMappedByteBuffer
(Path filePath) static BufferedImage
getFileAsScaledImage
(Path file, int width, int height) static final String
getFileAsString
(String path) static final String
getFileAsString
(Path path) static String
getFileMD5
(String path) static String
getFileMD5
(Path path) static String
getFileSHA256
(String path) static String
getFileSHA256
(Path path) static final String
getMimeType
(Path file) static Path
static Path
static final byte[]
getZippedSingleFileAsByteArray
(String fileName) static final byte[]
getZippedSingleFileAsByteArray
(Path filePath) static final String
getZippedSingleFileAsString
(String fileName) static final String
getZippedSingleFileAsString
(Path filePath) static final void
static final void
static Path
static final String
sanitizeFileName
(String name) static void
saveImageAsFileJpg
(BufferedImage image, String outputFile, float quality) static void
saveImageAsFileJpg
(BufferedImage image, Path outputFile, float quality) static void
saveImageAsFilePng
(BufferedImage image, String outputFile) static void
saveImageAsFilePng
(BufferedImage image, Path outputFile) static final void
writeByteArrayToFile
(String path, byte[] content) static final void
writeByteArrayToFile
(Path path, byte[] content) static final void
writeStringToFile
(String path, String content) static final void
writeStringToFile
(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:
IOException
NoSuchAlgorithmException
-
getFileMD5
- Löst aus:
IOException
NoSuchAlgorithmException
-
getFileSHA256
- Löst aus:
IOException
NoSuchAlgorithmException
-
getFileSHA256
- Löst aus:
IOException
NoSuchAlgorithmException
-
getFileAsJSON
public static final org.json.JSONObject getFileAsJSON(String path) throws IOException, org.json.JSONException - Löst aus:
IOException
org.json.JSONException
-
getFileAsJSON
public static final org.json.JSONObject getFileAsJSON(Path path) throws IOException, org.json.JSONException - Löst aus:
IOException
org.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
-