Article archive
Creates a file and sets it to read-only.
20/12/2011 10:39
import java.io.File;
import java.io.IOException;
public class FileAttributesDemo {
public static void main (String[] args) throws IOException {
// Cre
>>
———
Create a file and change its attribute to readonly
20/12/2011 10:39
import java.io.File;
import java.io.IOException;
public class FileAttributesDemo {
public static void main(String[] args) throws IOException {
// Create a new file, by&n
>>
———
Creates a file and sets it to read-only.
20/12/2011 10:38
import java.io.File;
import java.io.IOException;
public class FileAttributesDemo {
public static void main (String[] args) throws IOException {
// Cre
>>
———
File Class Enhancements
20/12/2011 10:38
import java.io.File;
public class DiskSpaceDemo {
public static void main(String[] args) {
File file = new File("C:");
long totalSpace = file.getTotal
>>
———
File: Get the total space
20/12/2011 10:37
import java.io.File;
public class SpaceChecker {
public static void main(String[] args) {
File[] roots = File.listRoots();
for (int i = 0; i 
>>
———
File: Get the usable space
20/12/2011 10:37
import java.io.File;
public class SpaceChecker {
public static void main(String[] args) {
File[] roots = File.listRoots();
for (int i = 0; i 
>>
———
File: Get the free space
20/12/2011 10:36
import java.io.File;
public class SpaceChecker {
public static void main(String[] args) {
File[] roots = File.listRoots();
for (int i = 0; i 
>>
———
Getting a Proper URL from a File Object
20/12/2011 10:36
import java.io.*;
import java.net.*;
public class FileURL {
public static void main(String args[]) throws MalformedURLException {
File file = new File("The End");
&
>>
———
File: List all roots
20/12/2011 10:35
import java.io.File;
public class SpaceChecker {
public static void main(String[] args) {
File[] roots = File.listRoots();
for (int i = 0; i 
>>
———
Set tree drag mode to DropMode.ON_OR_INSERT
20/12/2011 10:35
import java.awt.BorderLayout;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.i
>>