Package org.jclouds.mezeo.pcs.domain

Examples of org.jclouds.mezeo.pcs.domain.FileInfoWithMetadata


      connection.deleteContainer(container);
   }

   private FileInfoWithMetadata validateFileInfoAndNameIsInMetadata(URI container, URI objectURI, String name, Long size)
         throws InterruptedException, ExecutionException, TimeoutException {
      FileInfoWithMetadata response;
      connection.putMetadataItem(objectURI, "name", name);

      response = connection.getFileInfo(objectURI);
      validateFileInfo(response, container, name, size, "text/plain");

      assertEquals(response.getMetadataItems().get("name"), URI.create(objectURI.toASCIIString() + "/metadata/name"));

      validateMetadataItemNameEquals(objectURI, name);
      return response;
   }
View Full Code Here


   }

   public void testFileMetadata() {
      InputStream is = getClass().getResourceAsStream("/test_file_metadata.xml");

      FileInfoWithMetadata expects = new FileInfoWithMetadataImpl(
               URI
                        .create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3"),
               "testfile.txt",
               dateService.fromSeconds(1254000180),
               true,
               dateService.fromSeconds(1254000181),
               "adrian@jclouds.org",
               3,
               false,
               dateService.fromSeconds(1254000182),
               false,
               "text/plain",
               5,
               URI
                        .create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/content"),
               URI
                        .create("https://pcsbeta.mezeo.net/v2/containers/C4DA95C2-B298-11DE-8D7C-2B1FE4F2B99C"),
               URI
                        .create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/permissions"),
               URI
                        .create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/tags"),
               URI
                        .create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/metadata"),
               // Note that we should convert uppercase to lowercase, since most clouds do anyway

               ImmutableMap
                        .<String, URI> of(
                                 "foo",
                                 URI
                                          .create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/metadata/Foo")),
               URI
                        .create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/thumbnail"));

      FileInfoWithMetadata result = (FileInfoWithMetadata) factory.create(
               injector.getInstance(FileHandler.class)).parse(is);

      assertEquals(result, expects);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.mezeo.pcs.domain.FileInfoWithMetadata

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.