Package uk.org.microbase.filesystem.spi

Examples of uk.org.microbase.filesystem.spi.MicrobaseFS


    File sourceFile = new File("/tmp/foo.txt");
    Iterator<MicrobaseFS> impls = fsLoader.iterator();
    while (impls.hasNext())
    {
      MicrobaseFS impl = impls.next();
      System.out.println("Classname: " + impl.getClass().toString());

      try
      {
        impl.upload(sourceFile, "bucket1", "some/path/to/file", sourceFile.getName(), null);
        System.out.println("Uploaded file successfully");
      }
      catch (Exception e)
      {
        e.printStackTrace();
View Full Code Here


    System.out.println("Found the following implementations:");

    String filename = "foo.txt";
    String sourcePath = "/tmp/" + filename;
    File sourceFile = new File(sourcePath);
    MicrobaseFS fs = MicrobaseFSFactory.getDefaultProvider();
    System.out.println("Classname: " + fs.getClass().toString());

    String bucketName = "bucket1";
    String path = "a/file/path";
    try
    {
      fs.upload(sourceFile, bucketName, path, sourceFile.getName(), null);
      System.out.println("Uploaded file successfully");

      System.out.println("Bucket root directory list:");
      System.out.println(fs.listFiles(bucketName));

      System.out.println("Bucket/path directory list");
      System.out.println(fs.listFiles(bucketName, path));

      System.out.println(filename + " exists? " + fs.exists(bucketName, path, filename));
      System.out.println("bar.txt" + " exists? " + fs.exists(bucketName, path, "bar.txt"));
      System.out.println("baz.txt" + " exists? " + fs.exists(bucketName, path, "baz.txt"));

      System.out.println("Bucket list for bucket2: "+fs.listFiles("bucket2"));

    }
    catch (Exception e)
    {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of uk.org.microbase.filesystem.spi.MicrobaseFS

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.