throw new DataStoreException( String.format("Cannot update lastModified for blob. identifier=%s status=%s", key, blob.getCopyState().getStatusDescription()));
@Override public void renameFile(String from, String to, String pp) throws IOException { while (from.startsWith(File.separator)) from = from.substring(1); while (to.startsWith(File.separator)) to = to.substring(1); String fn = EncyptUtils.encString(from, Main.chunkStoreEncryptionEnabled); String tn = EncyptUtils.encString(to, Main.chunkStoreEncryptionEnabled); try { CloudBlockBlob sblob = container.getBlockBlobReference(pp + "/" + fn); CloudBlockBlob tblob = container.getBlockBlobReference(pp + "/" + tn); tblob.startCopy(sblob); while (tblob.getCopyState().getStatus() == CopyStatus.PENDING) { Thread.sleep(10); } if (tblob.getCopyState().getStatus() == CopyStatus.SUCCESS) { sblob.delete(); } else { throw new IOException( "unable to rename file " + fn + " because " + tblob.getCopyState().getStatus().name() + " : " + tblob.getCopyState().getStatusDescription()); } } catch (Exception e) { throw new IOException(e); } }