/** * Creates the share. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public void create() throws StorageException { this.create(null /* options */, null /* opContext */); }
CloudFileShare share = fileClient.getShareReference(UUID.randomUUID().toString()); try { share.create();
this.share = FileTestHelper.getRandomShareReference(); this.share.getProperties().setShareQuota(shareQuota); this.share.create(); assertNotNull(this.share.getProperties().getShareQuota()); assertEquals(shareQuota, this.share.getProperties().getShareQuota().intValue());
/** * Creates the share. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public void create() throws StorageException { this.create(null /* options */, null /* opContext */); }
@Test public void testDeleteShareSnapshotOptions() throws StorageException, URISyntaxException, IOException { // create share with metadata this.share.create(); assertTrue(this.share.exists()); // verify that exists() call on snapshot populates metadata CloudFileShare snapshot = this.share.createSnapshot(); CloudFileClient client = FileTestHelper.createCloudFileClient(); CloudFileShare snapshotRef = client.getShareReference(snapshot.name, snapshot.snapshotID); assertTrue(snapshotRef.exists()); try { share.delete(); } catch (final StorageException e) { assertEquals(StorageErrorCodeStrings.SHARE_HAS_SNAPSHOTS, e.getErrorCode()); } share.delete(DeleteShareSnapshotsOption.INCLUDE_SNAPSHOTS, null, null, null); assertFalse(share.exists()); assertFalse(snapshot.exists()); }
@Before public void fileTestMethodSetUp() throws URISyntaxException, StorageException { this.share = FileTestHelper.getRandomShareReference(); this.share.create(); }
@Test public void testListFilesAndDirectoriesWithinShareSnapshot() throws StorageException, URISyntaxException { this.share.create();
@Before public void cloudFileDirectorySetUp() throws URISyntaxException, StorageException { this.share = FileTestHelper.getRandomShareReference(); this.share.create(); }
this.create(options, opContext); return true;
this.create(options, opContext); return true;
@Before public void fileSASTestMethodSetUp() throws URISyntaxException, StorageException, IOException { if (fileClient == null) { fileClient = TestHelper.createCloudFileClient(); } this.share = FileTestHelper.getRandomShareReference(); this.share.create(); this.file = (CloudFile) FileTestHelper.uploadNewFile(this.share, 100, null); }
for (int i = 0; i < 30; i++) { shareList.add(prefix + i); fileClient.getShareReference(prefix + i).create();
/** * Try to create a share after it is created * * @throws StorageException */ @Test public void testCloudFileShareCreate() throws StorageException { this.share.create(); assertTrue(this.share.exists()); try { this.share.create(); fail("Share already existed but was created anyway."); } catch (StorageException e) { assertEquals(e.getErrorCode(), "ShareAlreadyExists"); assertEquals(e.getHttpStatusCode(), 409); assertEquals(e.getMessage(), "The specified share already exists."); } }
throws StorageException, InterruptedException, URISyntaxException { CloudFileClient client = FileTestHelper.createCloudFileClient(); this.share.create();
@Before public void fileEncryptionTestMethodSetup() throws URISyntaxException, StorageException, IOException { this.share = FileTestHelper.getRandomShareReference(); this.share.create(); this.dir = this.share.getRootDirectoryReference().getDirectoryReference("dir"); this.dir.create(); this.file = this.share.getRootDirectoryReference().getFileReference("file"); this.file.uploadText("text"); }
public void testCloudFileShareUploadMetadata() throws StorageException, URISyntaxException { this.share.getMetadata().put("key1", "value1"); this.share.create(); assertEquals(1, this.share.getMetadata().size()); assertEquals("value1", this.share.getMetadata().get("key1"));
/** * DeleteIfExists test. * * @throws StorageException */ @Test public void testCloudFileShareDeleteIfExists() throws StorageException { assertFalse(this.share.deleteIfExists()); this.share.create(); assertTrue(this.share.deleteIfExists()); assertFalse(this.share.exists()); assertFalse(this.share.deleteIfExists()); }
/** * Check a share's existence * * @throws StorageException */ @Test public void testCloudFileShareExists() throws StorageException { assertFalse(this.share.exists()); this.share.create(); assertTrue(this.share.exists()); assertNotNull(this.share.getProperties().getEtag()); this.share.delete(); assertFalse(this.share.exists()); }
share.create(); final CloudFile source = share.getRootDirectoryReference().getFileReference("source"); FileTestHelper.setFileProperties(source);
this.share.create();