Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 0b0e442

Browse files
committed
#267 Added logging of absolute file paths
1 parent af92e3a commit 0b0e442

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/com/marklogic/appdeployer/command/AbstractCommand.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ public void setResourceFilenamesIncludePattern(Pattern pattern) {
104104
*/
105105
protected String copyFileToString(File f) {
106106
try {
107+
File absoluteFile = f.getAbsoluteFile();
108+
if (logger.isDebugEnabled()) {
109+
logger.debug("Copying content from absolute file path: " + absoluteFile.getPath() + "; input file path: " + f.getPath());
110+
}
107111
return new String(FileCopyUtils.copyToByteArray(f.getAbsoluteFile()));
108112
} catch (IOException ie) {
109113
throw new RuntimeException(

src/main/java/com/marklogic/appdeployer/command/es/GenerateModelArtifactsCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,11 @@ protected void generateExtractionTemplate(AppConfig appConfig, GeneratedCode cod
281281
*/
282282
protected boolean fileHasDifferentContent(File existingFile, String content) {
283283
try {
284-
String fileContent = new String(FileCopyUtils.copyToByteArray(existingFile));
284+
String fileContent = copyFileToString(existingFile);
285285
fileContent = removeGeneratedAtTimestamp(fileContent);
286286
content = removeGeneratedAtTimestamp(content);
287287
return !fileContent.equals(content);
288-
} catch (IOException e) {
288+
} catch (RuntimeException e) {
289289
// Shouldn't occur, but if it does, treat it as the file having different content
290290
return true;
291291
}

0 commit comments

Comments
 (0)