mpatric/mp3agic — pull request #73 by TriangleRoot (2014-12-11 12:27:52+00:00)
Title: Add File constructors to Mp3File

Closes https://github.com/mpatric/mp3agic/issues/51

Adds constructors to Mp3File which takes File instead of String:

public Mp3File(File file)
public Mp3File(File file, int bufferLength)
public Mp3File(File file, int bufferLength, boolean scanFile)

Since filepath String is not supplied during construction, it is
determined via file.getPath() method. In order to ensure consistent
behavior independent of how Mp3File was constructed:

- [filename] variable has been removed from Mp3File's superclass
FileWrapper
- all methods that were referring to it now refer to file.getPath()

In order to prevent file separator related issues ("src/test/x.mp3" is a
valid argument for Mp3File(String filename) constructor, but e.g. on
Windows file.getPath() would return "src\test\x.mp3"):

- Mp3File's save() method now compares File objects instead of String
filepaths during equality test
- String literals in form of "src/test/x.mp3" in test cases were replaced
by "src" + fs + "test" + fs + "x.mp3" where [fs] stands for
File.separator