ÓÃJavaʵÏÖÎļþ·Ö¸î\ºÏ²¢²Ù×÷
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.sql.Timestamp;
import java.util.Arrays;
public class SmallToBig {
private String newFileName;// ÐÂÎļþÃû×Ö
private String filterName;// ¹ýÂ˹æÔòÃû×Ö
private String oldFileName;// ÀÏÎļþÃû×Ö
public SmallToBig(String oldFileName, String newFileName, String filterName) {
this.newFileName = newFileName;
this.filterName = filterName;
this.oldFileName = oldFileName;
}
public void unite() {
Timestamp startTime = null; // »ñµÃϵͳµÄ¿ªÊ¼Ê±¼ä
Timestamp endTime = null; // »ñµÃϵͳµÄ½áÊøʱ¼ä
startTime = new Timestamp(System.currentTimeMillis());
String[] fileNameTemp;
File inFile = new File("F:\\workspace\\glpt\\database\\temporaryfiles"); //ÁÙʱÎļþËùÔÚµÄĿ¼
File outFile = new File(newFileName); // È¡µÃÊä³öÎļþµÄÃû×Ö
RandomAccessFile outt = null;
byte[] bytes = new byte[2048];
try {
outt = new RandomAccessFile("F:\\workspace\\glpt\\database\\data\\"
+ outFile, "rw");
// È¡µÃ·ûºÏÌõ¼þµÄÎļþÃû
fileNameTemp = inFile.list(new FilenameFilter() {
public boolean accept(File dir, String name) {
System.out.println("dir = " + dir);
System.out.println("name = " + name);
String rr = new File(name).toString();
return rr.endsWith(filterName);
}
});
Arrays.sort(fileNameTemp);// ¶ÔÎļþÃûÅÅÐò
// ´ò¿ªËùÓеÄÎļþÔÙдÈëµ½Ò»¸öÎļþÀï
for (int i = 0; i < fileNameTemp.length; i++) {
for (int j = 0; j < fileNameTemp.length; j++) {
if (fileNameTemp[j].equals(oldFileName + i + filterName)) {
Sys
Ïà¹ØÎĵµ£º
¹úÍâÖøÃûjava¼¼Êõ×ÊÁÏÍøÕ¾
¹úÍâÖøÃûjava¼¼Êõ×ÊÁÏÍøÕ¾
http://www.onjava.com
O'ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ
http://java.sun.com
¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ - ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í
http://www.developer.com/java
Ó ......
½ñÌìÊÇÀ´´«ÖDz¥¿ÍµÄµÚÒ»Ì죬ÐÒ¿÷֮ǰ¿´¹ýthinking in java ¸Ð¾õÀí½â²»ÊǺܳÔÁ¦£¬µ«ÊǸоõͦÀÛµÄ
1¡£Íâ¹Ò²å¼þµÄ²½Ö裺
1£¬ÔÚeclipseµÄĿ¼Ï½¨Á¢linksĿ¼¡£
2£¬ÔÚlinksĿ¼Ï£¬½¨Á¢Ò»¸öÎļþ£¬ÄÚÈÝΪ²å¼þeclipseĿ¼µÄ¸¸Ä¿Â¼£»
path=²å¼þeclipseĿ¼µÄ¸¸Ä¿Â¼ path=F:\\Eclipse\\NLpack1-eclipse-SDK-3.2.1-w ......
°²×°»·¾³£º
1.ÉÏ´«jdk-6u17-linux-i586.binºÍapache-tomcat-6.0.20.tar.gzµ½/usr
2.°²×°JDK
¡¡¡¡$chmod a+x jdk-6u17-linux-i586.bin
¡¡¡¡$ ./jdk-6u17-linux-i586.bin
¡¡¡¡$ vi /etc/profile
¡¡¡¡#Ìí¼ÓÈçÏÂ
¡¡¡¡export JAVA_HOME=/usr/jdk1.6.0_17
¡¡¡¡export PATH=$JAVA_HOME/bin:$PATH
¡¡¡¡$echo $JAVA_H ......
Java Annotation×¢ÊÍÓï·¨£¨Ò»£©
¹Ø¼ü×Ö: java annotation×¢ÊÍ
JAVA´ÓJ2SE5¿ªÊ¼ÌṩÃûΪannotation£¨×¢ÊÍ£¬±ê×¢£©µÄ¹¦ÄÜ¡£JavaµÄannotation£¬¿ÉÒÔ¸½¼ÓÔÚpackage, class, method, fieldµÈÉÏÃ棬Ï൱ÓÚ¸øËüÃÇÌí¼ÓÁ˶îÍâµÄ¸¨ÖúÐÅÏ¢¡£¸½¼ÓÔÚpackage, class, method, fieldµÈÉϵÄAnnotation£¬Èç¹ûûÓÐÍⲿ½âÎö¹¤¾ßµÈ¶ÔÆä¼ÓÒÔ½â ......