Merge branch 'master' into subtree
[nikiroo-utils.git] / supported / InfoText.java
1 package be.nikiroo.fanfix.supported;
2
3 import java.io.File;
4 import java.io.IOException;
5 import java.net.URL;
6
7 import be.nikiroo.fanfix.data.MetaData;
8
9 /**
10 * Support class for <tt>.info</tt> text files ({@link Text} files with a
11 * <tt>.info</tt> metadata file next to them).
12 * <p>
13 * The <tt>.info</tt> file is supposed to be written by this program, or
14 * compatible.
15 *
16 * @author niki
17 */
18 class InfoText extends Text {
19 protected File getInfoFile() {
20 return new File(assureNoTxt(getSourceFile()).getPath() + ".info");
21 }
22
23 @Override
24 protected MetaData getMeta() throws IOException {
25 return InfoReader.readMeta(getInfoFile(), true);
26 }
27
28 @Override
29 protected boolean supports(URL url) {
30 return supports(url, true);
31 }
32 }