Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class VFSOutTransportInfo implements OutTransportInfo {
}

if (log.isDebugEnabled()) {
log.debug("Using the fileURI : " + this.outFileURI);
log.debug("Using the fileURI : " + VFSUtils.maskURLPassword(this.outFileURI));
log.debug("Using the maxRetryCount : " + maxRetryCount);
log.debug("Using the reconnectionTimeout : " + reconnectTimeout);
log.debug("Using the append : " + append);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ private void scanFileOrDirectory(final PollTableEntry entry, String fileURI) {
moveOrDeleteAfterProcessing(entry, fileObject);
} catch (AxisFault axisFault) {

logException("File object '" + fileObject.getURL().toString() + "' " +
logException("File object '" +
VFSUtils.maskURLPassword(fileObject.getName().getURI()) + "' " +
"cloud not be moved", axisFault);
entry.setLastPollState(PollTableEntry.FAILED);
String timeStamp =
Expand All @@ -254,8 +255,10 @@ private void scanFileOrDirectory(final PollTableEntry entry, String fileURI) {
if (entry.isFileLockingEnabled()) {
VFSUtils.releaseLock(fsManager, fileObject);
if (log.isDebugEnabled()) {
log.debug("Removed the lock file '" + fileObject.toString() +
".lock' of the file '" + fileObject.toString());
log.debug("Removed the lock file '" +
VFSUtils.maskURLPassword(fileObject.getName().getURI()) +
".lock' of the file '" +
VFSUtils.maskURLPassword(fileObject.getName().getURI()));
}
}
} else if (log.isDebugEnabled()) {
Expand All @@ -271,7 +274,9 @@ private void scanFileOrDirectory(final PollTableEntry entry, String fileURI) {
workerPool.execute(new FileRemoveTask(entry, fileObject));
}
if (log.isDebugEnabled()) {
log.debug("File '" + fileObject.getURL() + "' has been marked as a failed" +
log.debug("File '" +
VFSUtils.maskURLPassword(fileObject.getName().getURI()) +
"' has been marked as a failed" +
" record, it will not process");
}
}
Expand Down Expand Up @@ -304,7 +309,8 @@ private void scanFileOrDirectory(final PollTableEntry entry, String fileURI) {
//process the file
try {
if (log.isDebugEnabled()) {
log.debug("Processing file :" + child);
log.debug("Processing file :" +
VFSUtils.maskURLPassword(child.getName().getURI()));
}
processFile(entry, child);
successCount++;
Expand All @@ -324,7 +330,8 @@ private void scanFileOrDirectory(final PollTableEntry entry, String fileURI) {
try {
moveOrDeleteAfterProcessing(entry, child);
} catch (AxisFault axisFault) {
logException("File object '" + child.getURL().toString() +
logException("File object '" +
VFSUtils.maskURLPassword(child.getName().getURI()) +
"'cloud not be moved", axisFault);
failCount++;
entry.setLastPollState(PollTableEntry.FAILED);
Expand Down Expand Up @@ -355,7 +362,8 @@ private void scanFileOrDirectory(final PollTableEntry entry, String fileURI) {
workerPool.execute(new FileRemoveTask(entry, child));
}
if (log.isDebugEnabled()) {
log.debug("File '" + fileObject.getURL() +
log.debug("File '" +
VFSUtils.maskURLPassword(fileObject.getName().getURI()) +
"' has been marked as a failed record, it will not " +
"process");
}
Expand Down Expand Up @@ -430,27 +438,32 @@ private void moveOrDeleteAfterProcessing(final PollTableEntry entry, FileObject
try {
fileObject.moveTo(dest);
} catch (FileSystemException e) {
handleException("Error moving file : " + fileObject + " to " + moveToDirectoryURI, e);
handleException("Error moving file : " +
VFSUtils.maskURLPassword(fileObject.getName().getURI()) + " to " +
VFSUtils.maskURLPassword(moveToDirectoryURI), e);
}
} else {
try {
if (log.isDebugEnabled()) {
log.debug("Deleting file :" + fileObject);
log.debug("Deleting file :" +
VFSUtils.maskURLPassword(fileObject.getName().getURI()));
}
fileObject.close();
if (!fileObject.delete()) {
String msg = "Cannot delete file : " + fileObject;
String msg = "Cannot delete file : " +
VFSUtils.maskURLPassword(fileObject.getName().getURI());
log.error(msg);
throw new AxisFault(msg);
}
} catch (FileSystemException e) {
log.error("Error deleting file : " + fileObject, e);
log.error("Error deleting file : " +
VFSUtils.maskURLPassword(fileObject.getName().getURI()), e);
}
}

} catch (FileSystemException e) {
log.error("Error resolving directory to move after processing : "
+ moveToDirectoryURI, e);
+ VFSUtils.maskURLPassword(moveToDirectoryURI), e);
}
}

Expand Down Expand Up @@ -576,11 +589,14 @@ private void processFile(PollTableEntry entry, FileObject file) throws AxisFault
}

if (log.isDebugEnabled()) {
log.debug("Processed file : " + file + " of Content-type : " + contentType);
log.debug("Processed file : " +
VFSUtils.maskURLPassword(file.getName().getURI()) +
" of Content-type : " + contentType);
}

} catch (FileSystemException e) {
handleException("Error reading file content or attributes : " + file, e);
handleException("Error reading file content or attributes : " +
VFSUtils.maskURLPassword(file.getName().getURI()), e);

} finally {
try {
Expand Down Expand Up @@ -680,14 +696,10 @@ public void run() {
removeTaskState = STATE_STOPPED;
} catch (AxisFault axisFault) {
removeTaskState = STATE_RUNNING;
try {
log.error("Remove attempt '" + (count++) + "' failed for the file '" +
failedFileObject.getURL().toString() + "', next re-try will be " +
"after '" + nextRetryDuration + "' milliseconds");
} catch (FileSystemException e) {
log.error("Error while retrying the file url of the file object '" +
failedFileObject + "'");
}
log.error("Remove attempt '" + (count++) + "' failed for the file '" +
VFSUtils.maskURLPassword(failedFileObject.getName().getURI()) +
"', next re-try will be after '" + nextRetryDuration +
"' milliseconds");
try {
Thread.sleep(nextRetryDuration);
} catch (InterruptedException ignore) {
Expand Down Expand Up @@ -720,11 +732,13 @@ private synchronized void reTryFailedMove(PollTableEntry entry, FileObject fileO
try {
fileObject.moveTo(dest);
} catch (FileSystemException e) {
handleException("Error moving the failed file : " + fileObject + " to " +
moveToDirectoryURI, e);
handleException("Error moving the failed file : " +
VFSUtils.maskURLPassword(fileObject.getName().getURI()) + " to " +
VFSUtils.maskURLPassword(moveToDirectoryURI), e);
}
} catch (FileSystemException e) {
handleException("Cloud not move the failed file object '" + fileObject + "'", e);
handleException("Cloud not move the failed file object '" +
VFSUtils.maskURLPassword(fileObject.getName().getURI()) + "'", e);
} catch (IOException e) {
handleException("Cloud not create the folder", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ public void sendMessage(MessageContext msgCtx, String targetAddress,
}
} else {
handleException("Unsupported reply file type : " + replyFile.getType() +
" for file : " + vfsOutInfo.getOutFileURI());
" for file : " +
VFSUtils.maskURLPassword(vfsOutInfo.getOutFileURI()));
}
} else {
if (isUseTempFile) {
Expand All @@ -237,7 +238,7 @@ public void sendMessage(MessageContext msgCtx, String targetAddress,
}
} catch (FileSystemException e) {
handleException("Error resolving reply file : " +
vfsOutInfo.getOutFileURI(), e);
VFSUtils.maskURLPassword(vfsOutInfo.getOutFileURI()), e);
} finally {
if (replyFile != null) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public synchronized static boolean acquireLock(FileSystemManager fsManager, File
FileObject lockObject = fsManager.resolveFile(fullPath + ".lock");
if (lockObject.exists()) {
log.debug("There seems to be an external lock, aborting the processing of the file "
+ fo.getName() + ". This could possibly be due to some other party already "
+ maskURLPassword(fo.getName().getURI())
+ ". This could possibly be due to some other party already "
+ "processing this file or the file is still being uploaded");
} else {

Expand All @@ -144,7 +145,7 @@ public synchronized static boolean acquireLock(FileSystemManager fsManager, File
} catch (IOException e) {
lockObject.delete();
log.error("Couldn't create the lock file before processing the file "
+ fullPath, e);
+ maskURLPassword(fullPath), e);
return false;
} finally {
lockObject.close();
Expand Down Expand Up @@ -191,7 +192,7 @@ public static void releaseLock(FileSystemManager fsManager, FileObject fo) {
}
} catch (FileSystemException e) {
log.error("Couldn't release the lock for the file : "
+ fo.getName() + " after processing");
+ maskURLPassword(fo.getName().getURI()) + " after processing");
}
}

Expand Down
Loading