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

📄 makespread.java

📁 mail sent and revesive system jsp+mysql
💻 JAVA
字号:
package fengyun.Fastmail.util;

import java.io.File;
import java.io.IOException;

/**
 * 创建分布的目录
 * @author fengyun
 * @version 1.00
 */
public class MakeSpread {
	
	/**
	 * 创建
	 * @param max 分布个数
	 */
	public static void make(String home,int max,String owner) {
		for (int i = 1; i <= max; i++) {
			File spread = new File(home + File.separator + i);			if (spread.exists()) continue;
			else spread.mkdir();
		}
		if (owner == null) 
			owner="virtual";
		File file = new File(home);		try {			Runtime chg=Runtime.getRuntime();			chg.exec("/bin/chown -R " + owner + ". " + file.getAbsolutePath());			chg.exec("/bin/chmod -R 711 " + file.getAbsolutePath());		}		catch(IOException ioe) {			ioe.printStackTrace();		}	}
	public static void main(String[] args) {
		if (args.length < 2) {
			System.out.println("java MakeSpread home maxnumber owner");
		}
		try {
			if (args.length == 3) {
				make(args[0],Integer.parseInt(args[1]),args[2]);
			}
			else {
				make(args[0],Integer.parseInt(args[1]),null);
			}
		}
		catch(Exception e) {
			e.printStackTrace();
		}
	}
}

⌨️ 快捷键说明

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