public void qcstorGetObject()
        {
            EvnContext evn        = EvnContext.loadFromFile(System.Environment.CurrentDirectory + "/tmp/test_key.csv");
            String     bucketName = "java-bucket";
            Bucket     ss         = new Bucket(evn, bucketName);
            String     objectName = "2.txt";

            Bucket.GetObjectInput bb = new Bucket.GetObjectInput();

            //bb.setIfMatch("cda0a741aac6541c730ed6be6c6f5bcc");
            Bucket.GetObjectOutput dd = ss.getObject(objectName, bb);
            Console.WriteLine(dd + "");

            if (dd != null && dd.getBodyInputStream() != null)
            {
                FileStream   ff = new FileStream("D:\\5.txt", FileMode.OpenOrCreate);
                StreamWriter os = new StreamWriter(ff);
                string       buffer;
                while ((buffer = dd.getBodyInputStream().ReadLine()) != null)
                {
                    os.WriteLine(buffer);
                }
                os.Flush();
                os.Close();
                ff.Close();
                dd.getBodyInputStream().Close();
            }
        }
Esempio n. 2
0
        public void get_object_content_length_is(int arg1)
        {
            // Write code here that turns the phrase above into concrete actions

            if (getObjectOutput != null && getObjectOutput.getBodyInputStream() != null)
            {
                FileStream   ff = new FileStream("D:\\5.txt", FileMode.OpenOrCreate);
                StreamWriter sw = new StreamWriter(ff);
                string       buffer;
                while ((buffer = getObjectOutput.getBodyInputStream().ReadLine()) != null)
                {
                    sw.Write(buffer);
                }
                sw.Close();
                getObjectOutput.getBodyInputStream().Close();
            }
            //TestUtil.assertEqual(iLength,arg1);
        }