All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mpatric.mp3agic.FileWrapper Maven / Gradle / Ivy

Go to download

A java library for reading mp3 files and manipulating mp3 file ID3 tags (ID3v1 and ID3v2.2 to ID3v2.4).

There is a newer version: 0.9.1
Show newest version
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