@@ -0,0 +1,2950 @@
+/*%0ACopyright 2015 Aalto University, Hussnain Ahmed%0A %0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A %0A    http://www.apache.org/licenses/LICENSE-2.0%0A %0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A %0A*/%0A%0Aimport java.io.*;%0Aimport com.microsoft.azure.storage.*;%0Aimport com.microsoft.azure.storage.blob.*;%0Aimport org.apache.hadoop.fs.*;%0Aimport org.apache.hadoop.conf.*;%0A %0Apublic class BlobSample %7B%0A        public static final String storageConnectionString = %22DefaultEndpointsProtocol=http;%22%0A                        + %22AccountName=account_name_here;%22%0A                        + %22AccountKey=account_key_here%22;%0A %0A        public static void main(String%5B%5D args) %7B%0A                try %7B%0A %0A                        String filePath = %22hdfs://localhost.localdomain:8020/tmp/hive-mapred/%22%0A                                        + args%5B0%5D + %22/000000_0%22; // File location%0A %0A                        Configuration configuration = new Configuration();%0A %0A                        Path path = new Path(filePath);%0A                        Path newFilePath = new Path(%22temp_%22 + args%5B0%5D);%0A                        FileSystem fs = path.getFileSystem(configuration);%0A                       %0A                        fs.copyToLocalFile(path, newFilePath);%0A                        // Copy temporary to local directory%0A %0A                        CloudStorageAccount account = CloudStorageAccount%0A                                        .parse(storageConnectionString);%0A                        CloudBlobClient serviceClient = account.createCloudBlobClient();%0A %0A                        CloudBlobContainer container = serviceClient%0A                                        .getContainerReference(%22container_name_here%22); // Container name (must be lower case)%0A                        container.createIfNotExists();%0A %0A                        // Upload file%0A                        CloudBlockBlob blob = container%0A                                        .getBlockBlobReference(%22user/rdp_username_here/analysisFiles/%22%0A                                                        + args%5B0%5D + %22.tsv%22);%0A                        File sourceFile = new File(newFilePath.toString());%0A                        blob.upload(new FileInputStream(sourceFile), sourceFile.length());%0A %0A                        File tmpFile = new File(newFilePath.toString());%0A                        tmpFile.delete(); // Delete the temporary file%0A                       %0A                       %0A                        // In case of errors%0A                %7D catch (Exception e) %7B%0A                        System.exit(-1);%0A                %7D%0A        %7D%0A

Create TweetUpload.java