Klasse FileIO
java.lang.Object
de.luckymcdev.foundryengine.util.common.FileIO
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifikator und TypMethodeBeschreibungstatic voidappendText(Path path, String content) static voidCopies a file, or a whole directory tree.static voidZips a directory.static voidcreateZipFromFiles(List<Path> files, Path zipPath) Zips individual files flat (by file name).static booleanDeletes a file, or a directory including its contents.static voiddeleteDirectory(Path path) static voidDownloads to a temp file next todestPathand moves it into place on success, so a failed download never leaves a partial file or destroys an existing one.static booleanTrue if a file OR directory exists atpath.static voidextractZip(Path zipPath, Path destDir) static voidextractZipDirectory(Path zipPath, String dirEntry, Path destDir) Extracts everything belowdirEntry(e.g.static PathgameDir()static booleanisDirectory(Path path) static booleanlistRecursive(Path path) Lists all regular files belowpath.static FileIO.FileMetadatastatic voidstatic byte[]static Stringstatic StringreadZipEntry(Path zipPath, String entryName) static byte[]readZipEntryBytes(Path zipPath, String entryName) static Pathstatic voidsaveZipEntry(Path zipPath, String entryName, Path destPath) Extracts a single entry todestPath.static voidwriteBytes(Path path, byte[] bytes) static void
-
Konstruktordetails
-
FileIO
public FileIO()
-
-
Methodendetails
-
gameDir
-
resolve
- Löst aus:
IOException
-
readText
- Löst aus:
IOException
-
readLines
- Löst aus:
IOException
-
writeText
- Löst aus:
IOException
-
appendText
- Löst aus:
IOException
-
readBytes
- Löst aus:
IOException
-
writeBytes
- Löst aus:
IOException
-
copy
Copies a file, or a whole directory tree. For directories the contents ofsourceare merged intotarget(existing files are replaced). Symbolic links inside a copied tree are skipped.- Löst aus:
IOException
-
delete
Deletes a file, or a directory including its contents. A symbolic link is removed without touching what it points to.- Gibt zurück:
- true if something was deleted
- Löst aus:
IOException
-
deleteDirectory
- Löst aus:
IOException
-
mkdirs
- Löst aus:
IOException
-
list
- Löst aus:
IOException
-
listRecursive
Lists all regular files belowpath.- Löst aus:
IOException
-
exists
True if a file OR directory exists atpath.- Löst aus:
IOException
-
isFile
- Löst aus:
IOException
-
isDirectory
- Löst aus:
IOException
-
metadata
- Löst aus:
IOException
-
createZip
Zips a directory. Empty directories are kept; the zip itself is never included.- Löst aus:
IOException
-
createZipFromFiles
Zips individual files flat (by file name). Two files with the same name are rejected.- Löst aus:
IOException
-
listZip
- Löst aus:
IOException
-
readZipEntry
- Löst aus:
IOException
-
readZipEntryBytes
- Löst aus:
IOException
-
extractZip
- Löst aus:
IOException
-
extractZipDirectory
public static void extractZipDirectory(Path zipPath, String dirEntry, Path destDir) throws IOException Extracts everything belowdirEntry(e.g. "level/") intodestDir, with thedirEntryprefix stripped. An emptydirEntryextracts the whole zip.- Löst aus:
IOException
-
saveZipEntry
Extracts a single entry todestPath. IfentryNamerefers to a directory ("level" or "level/"), its contents are extracted intodestPath.- Löst aus:
IOException
-
download
Downloads to a temp file next todestPathand moves it into place on success, so a failed download never leaves a partial file or destroys an existing one.- Löst aus:
IOException
-