Package com.rackspacecloud.client.cloudfiles

Examples of com.rackspacecloud.client.cloudfiles.FilesClient.login()


    client = new FilesClient(FilesUtil.getProperty("username"),
                    FilesUtil.getProperty("password") + " this is a bogus password",
                    FilesUtil.getProperty("account"));
    try {
     
      assertFalse(client.login());
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
 
View Full Code Here


    String filename = makeFileName("accountinfo");
    FilesClient client = new FilesClient();
    try {
      client.useSnet();
      assertTrue(client.usingSnet());
      assertTrue(client.login());
     
      // Make sure it's not there
      assertFalse(client.containerExists(containerName));
     
      // Add it
View Full Code Here

    String fullPath = FilenameUtils.concat(SYSTEM_TMP.getAbsolutePath(), filename);
    try {
      byte[] content = makeRandomFile(fullPath);
      client.useSnet();
      assertTrue(client.usingSnet());
      assertTrue(client.login());
      String containerName = createTempContainerName("file-not-there");
      client.createContainer(containerName);
     
      String[] names =  new String[10];
      for(int i=0; i < 10; ++i) names[i] = "File" + (i + 1) + ".txt";
View Full Code Here

  public void testContainerCreation() {
    FilesClient client = new FilesClient();
    try {
      client.useSnet();
      assertTrue(client.usingSnet());
      assertTrue(client.login());
      String containerName = createTempContainerName("");
     
      // Make sure it's not there
      assertFalse(client.containerExists(containerName));
     
View Full Code Here

    }
  }
  public void testSnetToggle() {
    FilesClient client = new FilesClient();
    try {
      assertTrue(client.login());
      client.useSnet();
      assertTrue(client.usingSnet());
      String containerName = createTempContainerName("");
     
      // Make sure it's not there
View Full Code Here

  }

  public static void getContainerObjects (File localFolder, String containerName) throws IOException, HttpException, FilesAuthorizationException, NoSuchAlgorithmException, FilesException
  {
    FilesClient client = new FilesClient();
    if ( client.login() )
    {
      if (client.containerExists(containerName))
      {
        List<FilesObject> objects = client.listObjects(containerName);
        for (FilesObject obj: objects)
View Full Code Here

   * @throws FilesException
   */
  private static void copyToCreateContainerIfNeeded (File file, String mimeType,String containerName) throws IOException, HttpException, NoSuchAlgorithmException, FilesException
  {
    FilesClient client = new FilesClient();
    if ( client.login() )
    {
      if (client.containerExists(containerName))
      {
        logger.info ("Copying files to "+containerName);
        copyTo (file, mimeType, containerName);
View Full Code Here

   * @throws FilesException
   */
  private static void copyTo (File file, String mimeType,String containerName) throws IOException, HttpException, NoSuchAlgorithmException, FilesException
  {
    FilesClient client = new FilesClient();
    if ( client.login() )
    {
      if (client.containerExists(containerName))
        client.storeObject(containerName, file, mimeType);               
      else
      {
View Full Code Here

  public void testContainerNotThereDeletion() {
    FilesClient client = new FilesClient();
    try {
      client.useSnet();
      assertTrue(client.usingSnet());
      assertTrue(client.login());
      String containerName = createTempContainerName("I'mNotHere!");
     
      // Make sure it's not there
      assertFalse(client.containerExists(containerName));
     
View Full Code Here

  public void testContainerCreationWithSpaces() {
    FilesClient client = new FilesClient();
    try {
      client.useSnet();
      assertTrue(client.usingSnet());
      assertTrue(client.login());
      String containerName = createTempContainerName("with space+and+plus");
     
      // Make sure it's not there
      assertFalse(client.containerExists(containerName));
     
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.