Examples of FilesObject


Examples of com.rackspacecloud.client.cloudfiles.FilesObject

     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(10, objects.size());
      for (int i=0; i < 10; i++) {
        FilesObject obj = objects.get(i);
        assertEquals("testfile" + i + ".bogus", obj.getName());
        assertEquals("application/octet-stream", obj.getMimeType());
      }

      // Now do a limit
      objects = client.listObjects(containerName, 3);
      assertEquals(3, objects.size());
      for (int i=0; i < 3; i++) {
        FilesObject obj = objects.get(i);
        assertEquals("testfile" + i + ".bogus", obj.getName());
        assertEquals("application/octet-stream", obj.getMimeType());
      }
     
      // Now check out a marker
      objects = client.listObjects(containerName, 4, "testfile3.bogus");
      assertEquals(4, objects.size());
      for (int i=0; i < 4; i++) {
        FilesObject obj = objects.get(i);
        assertEquals("testfile" + (i + 4) + ".bogus", obj.getName());
        assertEquals("application/octet-stream", obj.getMimeType());
      }
     
      // Clean up
      for (int i=0; i < 10; i++) {
        client.deleteObject(containerName, "testfile" + i + ".bogus");
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertEquals(randomData.length/8192 + 1, callback.nCalls);
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertNotNull(client.storeStreamedObject(containerName, new ByteArrayInputStream(randomData), "application/octet-stream", filename, new HashMap<String,String>()));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertTrue(client.storeObject(containerName, randomData, "application/octet-stream", filename, new HashMap<String,String>()));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertNotNull(client.storeObjectAs(containerName, new File(fullPath), "application/octet-stream", filename));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      assertNotNull(obj.getMetaData());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
     
      // See that the CDN URL works
      FilesObject obj = objects.get(0);
      assertEquals(cdnUrl + "/" + filename, obj.getCDNURL());
     
      // Clean up
      client.deleteObject(containerName, filename);
      assertTrue(client.deleteContainer(containerName));
     
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

     
      List<FilesObject> allObjects = client.listObjects(containerName);
     
      assertEquals(1, allObjects.size());
     
      FilesObject obj = allObjects.get(0);
      assertEquals(0, obj.getSize());
      assertEquals("application/directory", obj.getMimeType());
     
      // If we don't throw an exception, we should be OK
      client.getObject(containerName, "test");
     
      // Delete it
View Full Code Here

Examples of org.apache.openmeetings.data.beans.files.FilesObject

 
  public FilesObject createListObjectLibraryByFileDocument(Element fileElement){
    try {
     
      log.info("createListObjectLibraryByFileDocument"+fileElement);
      FilesObject fileObject = new FilesObject();
      fileObject.setFileName(fileElement.getText());
      fileObject.setLastModified(fileElement.attribute("lastmod").getText());
      fileObject.setFileBytes(fileElement.attribute("size").getText());
      return fileObject;
    } catch (Exception err) {
      log.error("createListObjectLibraryByFileDocument",err);
    }
    return null;
View Full Code Here

Examples of org.apache.openmeetings.data.beans.files.FilesObject

     
      for (@SuppressWarnings("unchecked")
      Iterator<Element> i = fileElement.elementIterator(); i.hasNext(); ) {
        Element thumbElement = i.next();
        log.info("createListObjectLibraryByFileDocumentThumbs"+thumbElement);
        FilesObject singleThumb = new FilesObject();
        singleThumb.setFileName(thumbElement.getName());
        singleThumb.setFileNamePure(thumbElement.getText());
        singleThumb.setLastModified(thumbElement.attribute("lastmod").getText());
        singleThumb.setFileBytes(thumbElement.attribute("size").getText());
        thumbMap.add(singleThumb);
      }
     
      return thumbMap;
     
View Full Code Here

Examples of org.apache.openmeetings.db.dto.file.FilesObject

 
  public FilesObject createListObjectLibraryByFileDocument(Element fileElement){
    try {
     
      log.info("createListObjectLibraryByFileDocument"+fileElement);
      FilesObject fileObject = new FilesObject();
      fileObject.setFileName(fileElement.getText());
      fileObject.setLastModified(fileElement.attribute("lastmod").getText());
      fileObject.setFileBytes(fileElement.attribute("size").getText());
      return fileObject;
    } catch (Exception err) {
      log.error("createListObjectLibraryByFileDocument",err);
    }
    return null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.