Add more logs
This commit is contained in:
parent
cfedda5291
commit
d85dac7a9a
|
@ -62,6 +62,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
|
|||
|
||||
@Override
|
||||
public boolean blobExists(String blobName) {
|
||||
logger.debug("blobExists({})", blobName);
|
||||
try {
|
||||
return blobStore.blobExists(blobStore.container(), buildKey(blobName));
|
||||
} catch (URISyntaxException | StorageException e) {
|
||||
|
@ -72,6 +73,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
|
|||
|
||||
@Override
|
||||
public InputStream readBlob(String blobName) throws IOException {
|
||||
logger.debug("readBlob({})", blobName);
|
||||
try {
|
||||
return blobStore.getInputStream(blobStore.container(), buildKey(blobName));
|
||||
} catch (StorageException e) {
|
||||
|
@ -86,6 +88,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
|
|||
|
||||
@Override
|
||||
public void writeBlob(String blobName, InputStream inputStream, long blobSize) throws IOException {
|
||||
logger.debug("writeBlob({}, stream, {})", blobName, blobSize);
|
||||
try (OutputStream stream = createOutput(blobName)) {
|
||||
Streams.copy(inputStream, stream);
|
||||
}
|
||||
|
@ -93,6 +96,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
|
|||
|
||||
@Override
|
||||
public void writeBlob(String blobName, BytesReference bytes) throws IOException {
|
||||
logger.debug("writeBlob({}, bytes)", blobName);
|
||||
try (OutputStream stream = createOutput(blobName)) {
|
||||
bytes.writeTo(stream);
|
||||
}
|
||||
|
@ -115,6 +119,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
|
|||
|
||||
@Override
|
||||
public void deleteBlob(String blobName) throws IOException {
|
||||
logger.debug("deleteBlob({})", blobName);
|
||||
try {
|
||||
blobStore.deleteBlob(blobStore.container(), buildKey(blobName));
|
||||
} catch (URISyntaxException | StorageException e) {
|
||||
|
@ -125,6 +130,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
|
|||
|
||||
@Override
|
||||
public Map<String, BlobMetaData> listBlobsByPrefix(@Nullable String prefix) throws IOException {
|
||||
logger.debug("listBlobsByPrefix({})", prefix);
|
||||
|
||||
try {
|
||||
return blobStore.listBlobsByPrefix(blobStore.container(), keyPath, prefix);
|
||||
|
@ -136,6 +142,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
|
|||
|
||||
@Override
|
||||
public void move(String sourceBlobName, String targetBlobName) throws IOException {
|
||||
logger.debug("move({}, {})", sourceBlobName, targetBlobName);
|
||||
try {
|
||||
String source = keyPath + sourceBlobName;
|
||||
String target = keyPath + targetBlobName;
|
||||
|
@ -154,6 +161,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
|
|||
|
||||
@Override
|
||||
public Map<String, BlobMetaData> listBlobs() throws IOException {
|
||||
logger.debug("listBlobs()");
|
||||
return listBlobsByPrefix(null);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue