GetPaths() 공개 메소드

public GetPaths ( string domain, string key, bool noVerify ) : IList
domain string
key string
noVerify bool
리턴 IList
예제 #1
0
        public void Can_upload_file_screenshot()
        {
            var uri = new Uri("mogile://*****:*****@"C:\mogile_test_screenshot_larger.jpg", FileMode.Open))
            {
                arr = new byte[filestream.Length];
                Primelabs.Twingly.MogileFsApi.Utils.ByteReader.ReadWholeArray(filestream, arr);
            }

            var d = "screenshots";
            var key = "test_1";
            var client = new MogileFsClient(new Uri[] { uri });
            var paths = client.GetPaths(d, key, true);
            if (paths != null && paths.Count > 0)
                client.Delete(d, key);

            using (var filestream = new FileStream(@"C:\mogile_test_screenshot_larger.jpg", FileMode.Open)) {
                client.StoreFile(d, key, "original", filestream, 100000);
            }
            paths = client.GetPaths(d, key, true);
            Assert.AreEqual(2, paths.Count);

            byte[] arr2 = client.GetFileBytes(d, key, 10000);
            Assert.AreEqual(arr.Length, arr2.Length, "arr lengths not ok");
            for (int i = 0; i < arr2.Length; i++)
                Assert.AreEqual(arr[i], arr2[i], "contents do not match..");
        }
예제 #2
0
        public void Can_download_file()
        {
            var uri = new Uri("mogile://*****:*****@"C:\mogile_test_small_avatar.jpg", FileMode.Create)) {
                file.Write(arr, 0, arr.Length);
                file.Flush();
            }
        }
예제 #3
0
        public void Can_download_file_screenshot()
        {
            var uri = new Uri("mogile://*****:*****@"C:\mogile_test_screenshot_larger.jpg", FileMode.Create))
            {
                file.Write(arr, 0, arr.Length);
                file.Flush();
            }
        }