java.lang.System.setOut(new java.io.PrintStream(new java.io.OutputStream() {
java.io.ByteArrayOutputStream outputStream = new java.io.ByteArrayOutputStream();
@Override
public void write(int oneByte) throws java.io.IOException {
outputStream.write(oneByte);
textview1.setText(new String(outputStream.toByteArray()));
}
}));
FilePaths a = new FilePaths();
a.file("/storage/emulated/0/Gabriel.txt");
}
public static class FilePaths {
public static void file(String _src) {
displayInfo(_src);
}
public static void displayInfo(String f) {
try {
java.io.File file = new java.io.File(f);
System.out.println("========================================");
System.out.println(" name:" + file.getName());
System.out.println(" is directory:" + file.isDirectory());
System.out.println(" exists:" + file.exists());
System.out.println(" path:" + file.getPath());
System.out.println(" absolute file:" + file.getAbsoluteFile());
System.out.println(" absolute path:" + file.getAbsolutePath());
System.out.println("canonical file:" + file.getCanonicalFile());
System.out.println("canonical path:" + file.getCanonicalPath());
} catch (Exception e ) {
}
}
}
public void nothing() {
Komentar