⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m_iofilefilter.java

📁 自己用Java写的一个mp3文件改名的小工具
💻 JAVA
字号:
import java.io.File;
import java.io.FileFilter;

/**
 *  Description of the Class
 *
 * @author     kilo
 * @created    2003年12月22日
 */
public final class m_ioFileFilter
		 implements FileFilter {
	/**
	 *  Description of the Field
	 */
	protected boolean DirInclude;
	/**
	 *  Description of the Field
	 */
	protected String ExtendName;


	/**
	 * @param  DirInclude
	 * @param  ExtendName
	 * @roseuid            3FB707A7005D
	 */
	public m_ioFileFilter( boolean DirInclude, String ExtendName ) {
		this.DirInclude = DirInclude;
		this.ExtendName = ExtendName;
	}


	/**
	 * @param  f
	 * @return     java.lang.String
	 * @roseuid    3FB707A700FA
	 */
	private static String getExtension( File f ) {
	String ext = null;
	String s = f.getName();
	int i = s.lastIndexOf( '.' );

		if ( i > 0 && i < s.length() - 1 )
			ext = s.substring( i + 1 ).toLowerCase();

		return ext;
	}


	/**
	 * @param  f
	 * @return     boolean
	 * @roseuid    3FB2F6CC0399
	 */
	public boolean accept( File f ) {
		if ( f.isDirectory() == true && DirInclude == true )
			return true;
		else if ( f.isDirectory() == true && DirInclude != true )
			return false;
		else {
		String curFileExtension = getExtension( f );
			if ( curFileExtension == null )
				return false;
			if ( curFileExtension.compareToIgnoreCase( ExtendName ) == 0 )
				return true;
		}
		return false;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -