/** * Deletes the directory if it exists. * * @return <code>true</code> if the directory did not already exist and was created; otherwise, <code>false</code>. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public boolean deleteIfExists() throws StorageException, URISyntaxException { return this.deleteIfExists(null /* accessCondition */, null /* options */, null /* opContext */); }
/** * Deletes the directory if it exists. * * @return <code>true</code> if the directory did not already exist and was created; otherwise, <code>false</code>. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public boolean deleteIfExists() throws StorageException, URISyntaxException { return this.deleteIfExists(null /* accessCondition */, null /* options */, null /* opContext */); }
/** * Tests deleteIfExists for a directory. * * @throws URISyntaxException * @throws StorageException */ @Test @Category({ DevFabricTests.class, DevStoreTests.class, CloudTests.class }) public void testCloudFileDirectoryDeleteIfExists() throws URISyntaxException, StorageException { CloudFileDirectory directory = this.share.getRootDirectoryReference().getDirectoryReference("directory1"); assertFalse(directory.deleteIfExists()); directory.create(); assertTrue(directory.deleteIfExists()); assertFalse(directory.deleteIfExists()); }
assertFalse(directory.deleteIfExists()); assertTrue(directory.deleteIfExists()); assertFalse(directory.deleteIfExists()); assertFalse(directory.deleteIfExists(null, null, ctx));
@Test public void testSupportedDirectoryApisInShareSnapshot() throws StorageException, URISyntaxException { CloudFileDirectory dir = this.share.getRootDirectoryReference().getDirectoryReference("dir1"); dir.deleteIfExists(); dir.create(); HashMap<String, String> meta = new HashMap<String, String>();
@Test public void testSupportedFileApisInShareSnapshot() throws StorageException, URISyntaxException, UnsupportedEncodingException { CloudFileDirectory dir = this.share.getRootDirectoryReference().getDirectoryReference("dir1"); dir.deleteIfExists(); dir.create(); CloudFile file = dir.getFileReference("file");