Skip to content

Commit d251f4b

Browse files
committed
Internal refactoring
1 parent 6063322 commit d251f4b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/main/java/org/apache/commons/io/output/LockableFileWriter.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public Builder() {
8484
setBufferSize(AbstractByteArrayOutputStream.DEFAULT_SIZE);
8585
}
8686

87+
private File checkOriginFile() {
88+
return checkOrigin().getFile();
89+
}
90+
8791
/**
8892
* Constructs a new instance.
8993
* <p>
@@ -108,7 +112,7 @@ public Builder() {
108112
*/
109113
@Override
110114
public LockableFileWriter get() throws IOException {
111-
return new LockableFileWriter(checkOrigin().getFile(), getCharset(), append, lockDirectory.getFile().toString());
115+
return new LockableFileWriter(this);
112116
}
113117

114118
/**
@@ -165,6 +169,11 @@ public static Builder builder() {
165169
/** The lock file. */
166170
private final File lockFile;
167171

172+
private LockableFileWriter(final Builder builder) throws IOException {
173+
this(builder.checkOriginFile(), builder.getCharset(), builder.append, builder.lockDirectory.getFile().toString());
174+
}
175+
176+
168177
/**
169178
* Constructs a LockableFileWriter. If the file exists, it is overwritten.
170179
*

0 commit comments

Comments
 (0)