@@ -134,8 +134,11 @@ private OperationResponse handleFileOps(OperationResponse.OperationResponseBuild
134
134
int status , Path sourcePath ) {
135
135
try {
136
136
var source = sourcePath .toString ();
137
+ LOG .info ("source : {}" , source );
137
138
var destination = destinationPath .toString ();
139
+ LOG .info ("destination : {}" , source );
138
140
source = formatSourceDirName (source );
141
+ LOG .info ("formatSourceDirName : {}" , source );
139
142
rsync (source , destination );
140
143
enforceHtAccessRule (destinationPath , spashipMeta .second );
141
144
} catch (Exception e ) {
@@ -164,10 +167,13 @@ private OperationResponse handleFileOps(OperationResponse.OperationResponseBuild
164
167
165
168
private void rsync (String source , String destination ) throws IOException , InterruptedException {
166
169
// do not use `-a` as it tries to preserve file ownership and permissions leading to permission issues
170
+ LOG .info ("rsync process started" );
167
171
ProcessBuilder processBuilder = new ProcessBuilder ("rsync" , "-rlS" , "--delete" , source , destination );
172
+ LOG .info ("ProcessBuilder initialized" );
168
173
Process process = processBuilder .start ();
174
+ LOG .info ("Process started" );
169
175
int exitCode = process .waitFor ();
170
-
176
+ LOG . info ( "Process completed with exit the code {}" , exitCode );
171
177
if (exitCode == 0 ) {
172
178
LOG .info ("Synchronization completed successfully." );
173
179
} else {
@@ -278,16 +284,14 @@ private Tuple<String, SpashipMapping> extractSpashipMeta(String unZippedPath) {
278
284
}
279
285
280
286
281
- private int prepareDeploymentDirectory (String dirName , String parentDirectory , String contextPath ) {
287
+ private int prepareDeploymentDirectory (String dirName , String parentDirectory , String contextPath ) {
282
288
var isNestedContextPath = contextPath .contains (File .separator );
283
289
LOG .debug ("nested context path detection status {}" , isNestedContextPath );
284
-
285
290
// new status for identification of deployment in root directory
286
291
if (dirName .equalsIgnoreCase (parentDirectory )) {
287
292
LOG .debug ("deploying spa in root directory" );
288
293
return -1 ;
289
294
}
290
-
291
295
if (isSpaDirExists (dirName )) {
292
296
return 1 ;
293
297
}
@@ -309,7 +313,7 @@ private boolean isSpaDirExists(String dirName) {
309
313
return exists ;
310
314
}
311
315
312
- private void deleteDirectory (String dirName ) {
316
+ private void deleteDirectory (String dirName ) {
313
317
var dir = new File (dirName );
314
318
var deleted = false ;
315
319
try {
0 commit comments