Some operations with input/output in Java.
With this class u can create, copy, rename, move and delete files.

The class
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class Files {
private File file1;
private File file2;
private File dir1;
private long leng;
private boolean ok;
private InputStream in;
private OutputStream out;

public boolean CreateFile(String myFile) {
try {
this.file1 = new File(myFile);
this.ok = this.file1.createNewFile();
if (ok) {
return true;
} else {
return false;
}
} catch (IOException e) {
return true;
}

}

public boolean RenameFile(String myFileOld, String myFileNew) {
this.file1 = new File(myFileOld);
this.file2 = new File(myFileNew);
this.ok = this.file1.renameTo(this.file2);
if (this.ok) {
return true;
} else {
return false;
}
}

public boolean MoveFile(String myFile, String myDir) {
this.file1 = new File(myFile);
this.dir1 = new File(myDir);
this.ok = file1.renameTo(new File(dir1, file1.getName()));
if (this.ok) {
return true;
} else {
return false;
}
}

public void CopyFile(String myFileSrc, String myFileDst) throws FileNotFoundException, IOException {
this.in = new FileInputStream(myFileSrc);
this.out = new FileOutputStream(myFileDst);
byte[] buf = new byte[1024];
int len;
while ((len = this.in.read(buf)) > 0) {
this.out.write(buf, 0, len);
}
this.in.close();
this.out.close();
}

public Long FileSize(String myFile) {
this.file1 = new File(myFile);
this.leng = file1.length();
return this.leng / 1024;
}

public boolean DeleteFile(String myFile) {
this.ok = (new File(myFile)).delete();
if (this.ok) {
return true;
} else {
return false;
}
}
}

see u…