
com.mpatric.mp3agic.FileWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mp3agic Show documentation
Show all versions of mp3agic Show documentation
A java library for reading mp3 files and manipulating mp3 file ID3 tags (ID3v1 and ID3v2.2 to ID3v2.4).
package com.mpatric.mp3agic;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
public class FileWrapper {
protected File file;
protected String filename;
protected long length;
protected long lastModified;
protected FileWrapper() {
}
public FileWrapper(String filename) throws IOException {
this.filename = filename;
init();
length = file.length();
lastModified = file.lastModified();
}
private void init() throws IOException {
file = new File(filename);
if (!file.exists()) throw new FileNotFoundException("File not found " + filename);
if (!file.canRead()) throw new IOException("File not readable");
}
public String getFilename() {
return filename;
}
public long getLength() {
return length;
}
public long getLastModified() {
return lastModified;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy