@@ -0,0 +1,2564 @@
+/*%0A * To change this template, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage JSyndicateFS.test;%0A%0Aimport JSyndicateFS.Configuration;%0Aimport JSyndicateFS.FileSystem;%0Aimport JSyndicateFS.Path;%0Aimport java.io.FileNotFoundException;%0Aimport java.io.IOException;%0Aimport java.net.URI;%0Aimport java.net.URISyntaxException;%0A%0A/**%0A *%0A * @author iychoi%0A */%0Apublic class testFileIO %7B%0A    %0A    private static FileSystem filesystem;%0A    %0A    public static void initFS() throws IllegalAccessException, URISyntaxException, InstantiationException %7B%0A        Configuration conf = new Configuration();%0A        conf.setMSUrl(new URI(%22http://localhost:8080%22));%0A        conf.setUGName(%22Hadoop%22);%0A        conf.setUGPassword(%22sniff%22);%0A        conf.setVolumeName(%22SyndicateHadoop%22);%0A        conf.setVolumeSecret(%22sniff%22);%0A        conf.setPort(32780);%0A%0A        System.out.println(%22JSyndicateFS is Opening%22);%0A        filesystem = FileSystem.getInstance(conf);%0A    %7D%0A    %0A    public static void uninitFS() throws IOException %7B%0A        System.out.println(%22JSyndicateFS is Closing%22);%0A        filesystem.close();%0A    %7D%0A    %0A    public static void createNewFile() throws IOException %7B%0A        Path path = new Path(%22test1.txt%22);%0A        %0A        boolean result = filesystem.createNewFile(path);%0A        if(result)%0A            System.out.println(%22file created%22);%0A        else%0A            System.out.println(%22file creation failed%22);%0A    %7D%0A    %0A    public static void listRootFiles() throws FileNotFoundException, IOException %7B%0A        Path path = new Path(%22/%22);%0A        %0A        String%5B%5D entries = filesystem.readDirectoryEntries(path);%0A        if(entries != null) %7B%0A            System.out.println(%22number of entries : %22 + entries.length);%0A            for(String entry : entries) %7B%0A                System.out.println(%22file : %22 + entry);%0A            %7D%0A        %7D%0A    %7D%0A    %0A    public static void main(String%5B%5D args) %7B%0A        try %7B%0A            initFS();%0A            %0A            listRootFiles();%0A            %0A            createNewFile();%0A            %0A            Thread.sleep(3000);%0A            uninitFS();%0A        %7D catch (InstantiationException ex) %7B%0A            System.out.println(ex.toString());%0A        %7D catch (IOException ex) %7B%0A            System.out.println(ex.toString());%0A        %7D catch (URISyntaxException ex) %7B%0A            System.out.println(ex.toString());%0A        %7D catch (IllegalAccessException ex) %7B%0A            System.out.println(ex.toString());%0A        %7D catch (InterruptedException ex) %7B%0A            System.out.println(ex.toString());%0A        %7D%0A    %7D%0A%7D%0A

add test case