public static long getUsableSpace(final File pPath) { // NOTE: Allow null, to get space in current/system volume File path = pPath != null ? pPath : new File("."); Long space = getSpace16("getUsableSpace", path); if (space != null) { return space; } return getTotalSpace(path); }
public static void main(String[] pArgs) throws IOException { File file; if (pArgs[0].startsWith("file:")) { file = toFile(new URL(pArgs[0])); System.out.println(file); } else { file = new File(pArgs[0]); System.out.println(file.toURL()); } System.out.println("Free space: " + getFreeSpace(file) + "/" + getTotalSpace(file) + " bytes"); }
public static long getUsableSpace(final File pPath) { // NOTE: Allow null, to get space in current/system volume File path = pPath != null ? pPath : new File("."); Long space = getSpace16("getUsableSpace", path); if (space != null) { return space; } return getTotalSpace(path); }
public static long getUsableSpace(final File pPath) { // NOTE: Allow null, to get space in current/system volume File path = pPath != null ? pPath : new File("."); Long space = getSpace16("getUsableSpace", path); if (space != null) { return space; } return getTotalSpace(path); }
public static void main(String[] pArgs) throws IOException { File file; if (pArgs[0].startsWith("file:")) { file = toFile(new URL(pArgs[0])); System.out.println(file); } else { file = new File(pArgs[0]); System.out.println(file.toURL()); } System.out.println("Free space: " + getFreeSpace(file) + "/" + getTotalSpace(file) + " bytes"); }
public static void main(String[] pArgs) throws IOException { File file; if (pArgs[0].startsWith("file:")) { file = toFile(new URL(pArgs[0])); System.out.println(file); } else { file = new File(pArgs[0]); System.out.println(file.toURL()); } System.out.println("Free space: " + getFreeSpace(file) + "/" + getTotalSpace(file) + " bytes"); }