Java³£ÓôúÂë
/**
* ´´½¨Ò»¸öеÄÎļþ
* @param relativePath Ïà¶Ô·¾¶
* @param fileName ÎļþÃû
* @return
* @throws IOException
*/
public File createFile(String relativePath, String fileName) throws IOException {
String upPath = getFileUploadPath() + relativePath + "\\";
System.out.println("upPath:" + upPath);/////////////////////////////
System.out.println("fileName:" + fileName);/////////////////////////////
String nameWithoutExt = getNameWithoutExtension(fileName);
String ext = getExtension(fileName);
createDirectory(upPath);// ÉÏ´«Ä¿Â¼²»´æÔÚÔò´´½¨Ä¿Â¼
File newFile = new File(upPath + fileName);
// ÈôÓÐÖØÃûÎļþÔòÐÞ¸ÄÃû³Æ´´½¨ÐµÄÎļþ
for (int counter = 1; newFile.exists(); counter ++) {
fileName = nameWithoutExt + "(" + String.valueOf(counter) + ")." + ext;
newFile = new File(upPath + fileName);
}
newFile.createNewFile();
return newFile;
}
=================================================================================
/**
* ÎļþµÄдÈë (µ¥ÐÐдÈë)
* @param filePath(Îļþ·¾¶)
* @param fileName(ÎļþÃû)
* @param args
* @throws IOException
*/
public void writeF
Ïà¹ØÎĵµ£º
/*ÏÈ°ÑÏÂÔصÄÎļþ·ÅÔÚUpdateTempÎļþ¼ÐÖУ¬´ýÈ«²¿ÏÂÔغó£¬ÔÙ°Ñ´ËÎļþ¼ÐÖеÄÎļþÒƳöÌæ»»¾ÉÎļþ*/
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
......
µÚÒ»ÖÖDES¼ÓÃÜËã·¨
import java.security.Key;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
/**
*
* ʹÓÃDES¼ÓÃÜÓë½âÃÜ,¿É¶Ôbyte[],StringÀàÐͽøÐмÓÃÜÓë½âÃÜ ÃÜÎÄ¿ÉʹÓà ......
JavaÖеļòµ¥¹¤³§Ä£Ê½
¾ÙÁ½¸öÀý×ÓÒÔ¿ìËÙÃ÷°×JavaÖеļòµ¥¹¤³§Ä£Ê½£º
Å®æ´ÞÒÍÁÔìÈË
»°Ëµ£º“ÌìµØ¿ª±Ù£¬Î´ÓÐÈËÃñ£¬Å®æ´ÞÒÍÁΪÈË¡£”Å®æ´ÐèÒªÓÃÍÁÔì³öÒ»¸ö¸öµÄÈË£¬µ«ÔÚÅ®æ´Ôì³öÈË֮ǰ£¬È˵ĸÅÄîÖ»´æÔÚÓÚŮ洵Ä˼ÏëÀïÃæ¡£
Å®æ´ÔìÈË£¬Õâ¾ÍÊǼòµ¥¹¤³§Ä£Ê½µÄÓ¦Óá£
¡¡¡¡Ê×ÏÈ£ ......
ö¾ÙÀàÐÍÊÇJDK5.0µÄÐÂÌØÕ÷¡£SunÒý½øÁËÒ»¸öȫеĹؼü×ÖenumÀ´¶¨ÒåÒ»¸öö¾ÙÀà¡£ÏÂÃæ¾ÍÊÇÒ»¸öµäÐÍö¾ÙÀàÐ͵Ķ¨Ò壺
Java´úÂë
public enum Color{
RED,BLUE,BLACK,YELLOW,GREEN
}
public enum Color{
RED,BLUE,BLACK,YELLOW,GREEN
}
ÏÔ ......