Skip to content

Commit 1ecaa75

Browse files
committed
Merge #428 from 'metafacture-core-5.3.1rc' of https://github.com/metafacture/metafacture-core
2 parents a81f2bf + 462c8f8 commit 1ecaa75

File tree

2 files changed

+89
-3
lines changed

2 files changed

+89
-3
lines changed

metafacture-biblio/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies {
2727
exclude group: 'xercesImpl', module: 'xercesImpl'
2828
exclude group: 'xml-apis', module: 'xml-apis'
2929
}
30-
implementation 'org.apache.logging.log4j:log4j-core:2.14.1'
30+
implementation 'log4j:log4j:1.2.17'
3131
testImplementation 'junit:junit:4.12'
3232
testImplementation 'org.mockito:mockito-core:2.5.5'
3333
}

metafacture-xml/src/main/java/org/metafacture/xml/FilenameExtractor.java

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,72 +92,158 @@ class FilenameUtil {
9292
private int endIndex;
9393
private int startIndex;
9494

95-
FilenameUtil() {
95+
/**
96+
* Default constructor
97+
*/
98+
public FilenameUtil() {
9699
}
97100

98101
/**
99102
* Ensures that path exists. If not, make it.
100103
*
101104
* @param path
102-
* the path of the to be stored file.
105+
* the path of the to be stored file
103106
*/
104107
public void ensurePathExists(final File path) {
105108
final File parent = path.getAbsoluteFile().getParentFile();
106109
parent.mkdirs();
107110
}
108111

112+
/**
113+
* Sets the encoding used to open the resource.
114+
*
115+
* @param encoding
116+
* new encoding
117+
*/
109118
public void setEncoding(final String encoding) {
110119
this.encoding = encoding;
111120
}
112121

122+
/**
123+
* Returns the encoding used to open the resource.
124+
*
125+
* @return current default setting
126+
*/
113127
public String getEncoding() {
114128
return encoding;
115129
}
116130

131+
/**
132+
* Sets the suffix of the files.
133+
*
134+
* @param fileSuffix
135+
* the suffix of the files
136+
*/
117137
public void setFileSuffix(final String fileSuffix) {
118138
this.fileSuffix = fileSuffix;
119139
}
120140

141+
/**
142+
* Gets the suffix of the file.
143+
*
144+
* @return the suffix of the file
145+
*/
121146
public String getFileSuffix() {
122147
return fileSuffix;
123148
}
124149

150+
/**
151+
* Sets the filename.
152+
*
153+
* @param filename
154+
* the name of the file
155+
*/
125156
public void setFilename(final String filename) {
126157
this.filename = filename;
127158
}
128159

160+
/**
161+
* Gets the filename.
162+
*
163+
* @return the name of the file
164+
*
165+
*/
129166
public String getFilename() {
130167
return filename;
131168
}
132169

170+
/**
171+
* Sets the property which is used as the base of the filename.
172+
* Recommended properties are identifiers.
173+
*
174+
* @param property
175+
* the property which will be used for the base name of the file
176+
*/
133177
public void setProperty(final String property) {
134178
this.property = property;
135179
}
136180

181+
/**
182+
* Gets the property which is the base of the filename.
183+
*
184+
* @return the property which is the base name of the file
185+
*/
137186
public String getProperty() {
138187
return property;
139188
}
140189

190+
/**
191+
* Sets the target path.
192+
*
193+
* @param target
194+
* the basis directory in which the files are stored
195+
*/
141196
public void setTarget(final String target) {
142197
this.target = target;
143198
}
144199

200+
/**
201+
* Gets the target path.
202+
*
203+
* @return the basis directory in which the files are stored
204+
*/
145205
public String getTarget() {
146206
return target;
147207
}
148208

209+
/**
210+
* Sets the end of the index in the filename to extract the name of a
211+
* subfolder.
212+
*
213+
* @param endIndex
214+
* this marks the index' end
215+
*/
149216
public void setEndIndex(final int endIndex) {
150217
this.endIndex = endIndex;
151218
}
152219

220+
/**
221+
* Gets the end of the index in the filename to extract the name of a
222+
* subfolder.
223+
*
224+
* @return the marker of the index' end
225+
*/
153226
public int getEndIndex() {
154227
return endIndex;
155228
}
156229

230+
/**
231+
* Sets the beginning of the index in the filename to extract the name of
232+
* the subfolder.
233+
*
234+
* @param startIndex
235+
* This marks the index' beginning
236+
*/
157237
public void setStartIndex(final int startIndex) {
158238
this.startIndex = startIndex;
159239
}
160240

241+
/**
242+
* Gets the beginning of the index in the filename to extract the name of
243+
* the subfolder.
244+
*
245+
* @return the marker of the index' beginning
246+
*/
161247
public int getStartIndex() {
162248
return startIndex;
163249
}

0 commit comments

Comments
 (0)