FileDocCategorySizeDatePackage
FileSource.javaAPI Docjid3 0.462697Tue Nov 22 02:07:29 GMT 2005org.blinkenlights.jid3.io

FileSource

public class FileSource extends Object implements IFileSource
A concrete implementation of the IFileSource interface, allowing access to standard java.io.File objects.

Fields Summary
private File
m_oFile
Constructors Summary
public FileSource(File oFile)
Creates a new instance of FileSource

        m_oFile = oFile;
    
Methods Summary
public IFileSourcecreateTempFile(java.lang.String sPrefix, java.lang.String sSuffix)

        File oTmpFile = File.createTempFile("id3.", ".tmp", m_oFile.getAbsoluteFile().getParentFile());
        
        return new FileSource(oTmpFile);
    
public booleandelete()

        return m_oFile.delete();
    
public java.io.InputStreamgetInputStream()

        return new FileInputStream(m_oFile);
    
public java.lang.StringgetName()

        return m_oFile.getName();
    
public java.io.OutputStreamgetOutputStream()

        return new FileOutputStream(m_oFile);
    
public longlength()

        return m_oFile.length();
    
public booleanrenameTo(java.lang.String sFilename)

        return m_oFile.renameTo(new File(sFilename));
    
public booleanrenameTo(IFileSource oFileSource)

        if ( ! (oFileSource instanceof FileSource))
        {
            throw new IOException("Cannot rename between different file source types.");
        }
        return m_oFile.renameTo(((FileSource)oFileSource).m_oFile);
    
public java.lang.StringtoString()

        return m_oFile.toString();