Package edu.sdsc.grid.io.srb

Examples of edu.sdsc.grid.io.srb.SRBFile


        SRBFileExt file = new SRBFileExt(sys, "TestDir");
        boolean result = file.delete(true);
        assertEquals(result, true);

        //get folder again
        SRBFile afterDelete = new SRBFile(sys, "TestDir");

        assertEquals(afterDelete.exists(), false);
        assertEquals(child.exists(), false);
        assertEquals(child2.exists(), false);
    }
View Full Code Here


            {
                throw new FileSystemException("Cannot change permission without specifying user and user domain");
            }

            file.setStickyBit(isInherited, isRecurssive);
            SRBFile srbFile = file.getSRBFile();
            srbFile.changePermissions(perm, newUserName, newUserDomain, isRecurssive);
        }
        catch(Exception e)
        {
            throw new FileSystemException("Cannot change permssion " + e.toString());
View Full Code Here

        client.setFirewallPorts(64000, 65000);
        String home = client.getHomeDirectory();
        System.out.println("home: " + home);

        SRBFile file = new SRBFile(client, "/ngs/home");
        GeneralFile[] kids = file.listFiles();
        if(kids != null){
            for(int i=0; i<kids.length; i++){
                GeneralFile child = kids[i];
                String name = child.getName();
                boolean isDir = child.isDirectory();
View Full Code Here

        client.setFirewallPorts(64000, 65000);
        String home = client.getHomeDirectory();
        System.out.println("home: " + home);

        SRBFile file = new SRBFile(client, home + "/test.txt");

        //file.listFiles();
        assertTrue(file.exists());

        //boolean d = file.delete();
        //file.createNewFile();
        File filefrom = new File("/tmp/from.txt");
        assertTrue(filefrom.exists());
View Full Code Here

        // Load File info from the SRB server and:
        // set FileType (of this FileObject)
        log.debug("getInfo(): " + filePath);
        final SRBFileSystem client = this.fileSystem.getClient();
        try {
            this.file = new SRBFile(client, getName().getPath());

            // set this FileObjects FileType
            if (file.isDirectory()) {
                injectType(FileType.FOLDER);
View Full Code Here

      SRBAccount acct = new SRBAccount();

      edu.sdsc.grid.io.srb.SRBFileSystem fs =
        (edu.sdsc.grid.io.srb.SRBFileSystem) FileFactory.newFileSystem( acct );
     
      SRBFile f = (SRBFile)FileFactory.newFile(fs, acct.getHomeDirectory());
       
    System.out.println("MCAT Zone:" + acct.getMcatZone() + " Dom:" + acct.getDomainName() );
    System.out.println("Home:" + acct.getHomeDirectory() + " Def res:" + acct.getDefaultStorageResource());
   
    String[] children = f.list();
   
    for (int i = 0; i < children.length; i++) {
      System.out.println(children[i]);
    }
View Full Code Here

  private void uriSRBTest() throws URISyntaxException, IOException, FileNotFoundException
   {
 
    String uri = "srb://vsilva.NCC:secret@ebony:5544/nccZone/home/vsilva.NCC";
    SRBFile f = (SRBFile)FileFactory.newFile(new URI(uri));
    SRBAccount acct = (SRBAccount)f.getFileSystem().getAccount();

    System.out.println("MCAT Zone:" + acct.getMcatZone() + " Dom:" + acct.getDomainName() );
    System.out.println("Home:" + acct.getHomeDirectory() + " Def res:" + acct.getDefaultStorageResource());
   
    String[] children = f.list();
   
    for (int i = 0; i < children.length; i++) {
      System.out.println(children[i]);
    }
View Full Code Here

        SRBFileSystemConfigBuilder configurations = SRBFileSystemConfigBuilder.getInstance();
        configurations.setAccount(srbAccount, opts);
        //SRBFileSystem srbFs = (SRBFileSystem) VFS.getManager().resolveFile(getURIString(srbAccount), opts).getFileSystem().getAttribute(SRBVfsFileSystem.SRB_FILESYSTEM);
        SRBFileSystem srbFs = (SRBFileSystem) VFS.getManager().resolveFile(getURIString(srbAccount), opts).getFileSystem().getAttribute(SrbFileSystem.SRB_FILESYSTEM);

        String uriString = new SRBFile(srbFs, srbFs.getHomeDirectory()).toURI().toString();

        //SRB uri appends these characters which screw with the vfs module
        uriString = uriString.replace("?#", "");
        System.out.println(uriString);
       
View Full Code Here

      SRBAccount acct = new SRBAccount();

      edu.sdsc.grid.io.srb.SRBFileSystem fs =
        (edu.sdsc.grid.io.srb.SRBFileSystem) FileFactory.newFileSystem( acct );
     
      SRBFile f = (SRBFile)FileFactory.newFile(fs, acct.getHomeDirectory());
       
    System.out.println("MCAT Zone:" + acct.getMcatZone() + " Dom:" + acct.getDomainName() );
    System.out.println("Home:" + acct.getHomeDirectory() + " Def res:" + acct.getDefaultStorageResource());
   
    String[] children = f.list();
   
    for (int i = 0; i < children.length; i++) {
      System.out.println(children[i]);
    }
View Full Code Here

  private void uriSRBTest() throws URISyntaxException, IOException, FileNotFoundException
   {
 
    String uri = "srb://vsilva.NCC:secret@ebony:5544/nccZone/home/vsilva.NCC";
    SRBFile f = (SRBFile)FileFactory.newFile(new URI(uri));
    SRBAccount acct = (SRBAccount)f.getFileSystem().getAccount();

    System.out.println("MCAT Zone:" + acct.getMcatZone() + " Dom:" + acct.getDomainName() );
    System.out.println("Home:" + acct.getHomeDirectory() + " Def res:" + acct.getDefaultStorageResource());
   
    String[] children = f.list();
   
    for (int i = 0; i < children.length; i++) {
      System.out.println(children[i]);
    }
View Full Code Here

TOP

Related Classes of edu.sdsc.grid.io.srb.SRBFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.