NOTE: The Java API detailed here is in the process of being deprecated in favor of the Rackspace Cloud API for Java. For more details on our Java SDK, please visit our API docs site.
Contents |
Overview
In this tutorial we will cover installing the Cloud Files Java API For Both Windows and *nix (this should be the same for MacOSX). We assume you have Apache Ant installed and configured on your machine and the Java Run Time and JDK.
What we need
Windows Install
ant compile
If it says build successful You should have everything you need.
*nix Installation
cd ~/Desktop
Then
tar zxvf rackspace-java-cloudfiles-db47ab8e43ed0b291c4384b351e1edb8cbb394c8.tar.gz
ant compile
If it says build successful You should have everything you need.
Check our work
Now we will write a simple script to test jar we just made. Here is the code
import com.rackspacecloud.client.cloudfiles.*;
public class Test
{
public static void main (String args[])
{
}
}
Please note that you save the file as Test.java or you will throw a compilation error.
Once you have created and saved this script to your desktop run this command:
For Windows:
javac -classpath "C:\Documents and Settings\JimBob\Desktop\java-cloudfiles\dist\java-cloudfiles.jar" Test.java
For Linux:
javac -classpath /home/JimBob/Desktop/java-cloudfiles/dist/java-cloudfiles.jar Test.java
If everything compiles ok the package was created correctly.
If you get an error like this:
Test.java:1: package com.rackspacecloud.client.cloudfiles does not exist import com.rackspacecloud.client.cloudfiles.*; ^ 1 error
Then you are not specifying the correct path. Remember the paths provided in the commands above need to be replaced with the correct path to the jar file for your machine. If you have anymore questions or comments please feel free to shoot us an email at cloudfiles@rackspacecloud.com
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

6 Comments
Do you have a maven plugin
Thanks!!
Re: maven
wow, Ive never seen an api
re: api
<dependencies>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>cloudfiles-us</artifactId>
<version>1.5.5</version>
</dependency>
</dependencies>
That will bring in the minimum number of dependencies to work with Cloud Files US (use artifactId cloudfiles-uk for Cloud Files UK).
I get a 404 when navigating
When will it be available again?
Thanks
re: 404
You can get the API from:
https://github.com/rackerlabs/java-cloudfiles
And you can read more about the newer SDK here:
http://docs.rackspace.com/sdks/guide/content/java.html
Add new comment