English:
With this FileManagerAPI you can easy manage your Files like reading or writing.
Germany:
Mit dieser FileManagerAPI können sie ganz einfach in datein z.B. lesen order schreiben.
This FileManagerAPI is for Java 7 or higher.
How to use FileAPI? 1. Put the "FileAPI" in you plugin right next to your Main.java
2. You have to create the api in your Main.java like so
Code (Java):
publicclass Main
{
publicvoid onEnable
(){
FileAPI api
=new FileAPI
();// create a new FileAPI calles api api.
createFile("C:/Development/workspace/Test-Project",
"Testfile.txt");// define and create your filename and directory. // api.createFile(this.getDataFolder().getAbsolutePath(), "TestFile.txt"); # if you want to use it on a Server
// now you can do something like this: api.
writeInNextFreeLine("Line1");// Write "Line1" in the next free line in the File api.
writeInNextFreeLine("Line2");// Same but in line 2 api.
writeInNextFreeLine("Line3");// also the same but in Line 3
System.
out.
println("Line 2: "+ readline
(2));// The output will be "Line2"
} }
Code (Java):
createFile
();// NEEDED to create the File.
Code (Java):
getFilename
();// Return the name of the File.
Code (Java):
setFilename
();// You can change the Filename.
Code (Java):
getDirectory
();// Return the file directory.
Code (Java):
renameDirectory
();// Rename the current directory.
Code (Java):
setDirectory
();// Will change the directory.
Code (Java):
getFile
();// Return the complete File.
Code (Java):
setFile
();// Chnage the file if you have your own.
Code (Java):
renameFile
();// Rename the file.
Code (Java):
moveFile
();// Move the File to Another Directory.
Code (Java):
writeInNextFreeLine
();// Will write in the next free line in the File.
Code (Java):
writeOverrideAll
();// Will override the filecontent with the new.
Code (Java):
readAll
();// Will return an ArrayList with the filecontent.
Code (Java):
readLine
();// Will return the readed line as a String.
Code (Java):
writeInLine
();// Write in a specific line.
You are not allowed to sell this product.
You are not allowed to claim this project as your own.
The Code from the File is not 100% written by me most from it it inspired from the internet but it got compared to a file https://www.flaticon.com/free-icons/apiApi icons created by Smashicons - Flaticon