litesoft
Diff Revisions
71
vs
72
for /trunk/Java/core/Server/src/org/litesoft/util/FileReplacer.java
|
@@ -17,27 +17,29 @@ |
17 |
17 |
|
* Move Dir - Assume same volume! |
18 |
18 |
|
*/ |
19 |
19 |
|
@Override |
20 |
|
- |
protected void moveDir( File pSource, File pDestination ) |
|
20 |
+ |
protected boolean moveDir( File pSource, File pDestination ) |
21 |
21 |
|
{ |
22 |
22 |
|
DirectoryUtils.deleteIfExists( pDestination ); |
23 |
23 |
|
DirectoryUtils.moveFile( pSource, pDestination ); |
|
24 |
+ |
return true; |
24 |
25 |
|
} |
25 |
26 |
|
|
26 |
27 |
|
/** |
27 |
28 |
|
* Move File - Assume same volume! |
28 |
29 |
|
*/ |
29 |
30 |
|
@Override |
30 |
|
- |
protected void moveFile( File pSource, File pDestination ) |
|
31 |
+ |
protected boolean moveFile( File pSource, File pDestination ) |
31 |
32 |
|
{ |
32 |
33 |
|
FileUtils.deleteIfExists( pDestination ); |
33 |
34 |
|
DirectoryUtils.moveFile( pSource, pDestination ); |
|
35 |
+ |
return true; |
34 |
36 |
|
} |
35 |
37 |
|
|
36 |
38 |
|
/** |
37 |
39 |
|
* Update the existing pDestination from the pSource - Assume NOT the same volume! |
38 |
40 |
|
*/ |
39 |
41 |
|
@Override |
40 |
|
- |
protected void updateFile( File pSource, File pDestination ) |
|
42 |
+ |
protected boolean updateFile( File pSource, File pDestination ) |
41 |
43 |
|
{ |
42 |
44 |
|
String[] srcLines = FileUtils.loadTextFile( pSource ); |
43 |
45 |
|
String[] dstLines = FileUtils.loadTextFile( pDestination ); |
|
@@ -45,15 +47,18 @@ |
45 |
47 |
|
{ |
46 |
48 |
|
FileUtils.deleteIfExists( pDestination ); |
47 |
49 |
|
FileUtils.storeTextFile( pDestination, srcLines ); |
|
50 |
+ |
return true; |
48 |
51 |
|
} |
|
52 |
+ |
return false; |
49 |
53 |
|
} |
50 |
54 |
|
|
51 |
55 |
|
/** |
52 |
56 |
|
* Copy the pSource to the pDestination - Assume NOT the same volume! |
53 |
57 |
|
*/ |
54 |
58 |
|
@Override |
55 |
|
- |
protected void copyAddFile( File pSource, File pDestination ) |
|
59 |
+ |
protected boolean copyAddFile( File pSource, File pDestination ) |
56 |
60 |
|
{ |
57 |
61 |
|
FileUtils.storeTextFile( pDestination, FileUtils.loadTextFile( pSource ) ); |
|
62 |
+ |
return true; |
58 |
63 |
|
} |
59 |
64 |
|
} |