public MediaFile load(File f) 
            throws IOException {
        
        Registry.FileType fType=Registry.getFileType(f);
        if(fType!=null) {
        	this.changeProperty(fType.fileProperty);
        }        
        
        dropChildren();
        if(!f.isDirectory() && f.exists()) {
        	this.actualFile=f;
            log(this,Level.INFO,"Loading file");            
            
            String mimeType;
            if(getExtension().equals("jpg") || getExtension().equals("jpeg")) {
                mimeType="image/jpeg";
            } else if(getExtension().equals("png")) {
                mimeType="image/png";
            } else if(getExtension().equals("gif")) {
                mimeType="image/gif";
            } else {
                // TODO: guess at more mime types (at least supported image types)
            	mimeType=null;
            }

            // TODO: for image files, guess at id3PictureType (e.g. cover art etc)
            FileMetadata fm=new FileMetadata(this,f.getName(),mimeType,null,null,null);
        	this.setValue(fm);
        	if(fm.getImageAttributes()!=null) {
        		this.changeProperty(MediaProperty.PICTURE);
        	}

            try {
                loadTags();
            } catch (IOException ex) {
	        	log(this,Level.SEVERE,"error reading file: "+ex.toString());	            
            }
            // TODO: handle 0 byte FLAC/other files more gracefully than this..
        } else {
	        log(this,Level.WARNING,"Warning: File does not exist or is a directory: "+getFile().toString());
	        delete();
	        return null;
        }
        
        return this;
    }