Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert Use PathHandler for writing log files (#3420)"
This reverts commit 9949ca0.
- Loading branch information
Showing
18 changed files
with
148 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
liquibase-core/src/main/java/liquibase/resource/OpenOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package liquibase.resource; | ||
|
||
/** | ||
* Defines the options for opening {@link Resource}s in Liquibase. | ||
*/ | ||
public class OpenOptions { | ||
private boolean truncate; | ||
private boolean createIfNeeded; | ||
|
||
/** | ||
* Use default options of truncate = true, createIfNeeded = true; | ||
*/ | ||
public OpenOptions() { | ||
this.truncate = true; | ||
this.createIfNeeded = true; | ||
} | ||
|
||
/** | ||
* Should an existing file be truncated when opened. Both this and {@link #isAppend()} | ||
* are automatically kept in sync with each other. | ||
*/ | ||
public boolean isTruncate() { | ||
return truncate; | ||
} | ||
|
||
public OpenOptions setTruncate(boolean truncate) { | ||
this.truncate = truncate; | ||
return this; | ||
} | ||
|
||
/** | ||
* Should an existing file be appended to when opened. Both this and {@link #isTruncate()} | ||
* are automatically kept in sync with each other. | ||
*/ | ||
public boolean isAppend() { | ||
return !isTruncate(); | ||
} | ||
|
||
public OpenOptions setAppend(boolean append) { | ||
this.truncate = !append; | ||
return this; | ||
} | ||
|
||
/** | ||
* If true, create the resource if it does not exist. If false, do not create the resource. | ||
*/ | ||
public boolean isCreateIfNeeded() { | ||
return createIfNeeded; | ||
} | ||
|
||
public OpenOptions setCreateIfNeeded(boolean createIfNeeded) { | ||
this.createIfNeeded = createIfNeeded; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.