Free Java Utility To Touch Files (Cross Platform) الحرة جافا فائدة اتطرق الى ملفات (مرور)
This is a simple commandline Java utility which I wrote down in under 5 minutes to help in checking-in (svn commit) over 500 files which were modified but the dates weren't changed due to an error in our settings. وهذا هو بسيط commandline جافا المنفعه التي كتبت الى اسفل في اطار 5 دقائق للمساعدة فى فحص - في (SVN الالتزام (اكثر من 500 من الملفات التي تم تعديل التواريخ ولكن لم يتغير بسبب وجود خطأ في الاعدادات. So subversion failed to recognize it. الفتنة حتى انها لم تعترف. Anyway this simple utility updates the timestamp of any file(s) and directories recursively to current time . على اي حال هذا فائدة بسيطة ويستكمل الزمني للمن اي ملف (ق) والادله بشكل تكراري الى الوقت الحالي. It is extremely fast and cross-platform. وهو سريع للغاية وعبر المنهاج. It does one job and does it well. انها وظيفة واحدة وانه لا ايضا. It is named after the unix utility touch , with similar functionality. ومن اسماؤهم بعد على اتصال يونيكس فائدة ، مع وظائف مماثلة.
import java.io.File; /** Super-fast file / directory(recursive) touch. استيراد java.io.file ؛ / ** بسرعة فاءقه الملف / دليل (متكررة) على اتصال. * It doesn't ask for confirmation. * انها لا تطلب من اجل التصديق عليها. * Arguments: File / Directories to touch to current time. * الحجج : ملف / أدلة على ان اتطرق الى الوقت الحالي. */ public class Touch { public static void main(String ... args) { long time = System.currentTimeMillis(); for(String fileName:args) touch(new File(fileName), time); } /** Recursively touch file and directories. * / الطبقة العامة على اتصال (العامة ساكنة باطلة الرئيسية (الخيط... args) (وقت طويل = system.currenttimemillis () ؛ ل(الخيط الملف : args) على اتصال (ملف جديد (الملف) ، والوقت) ؛) / ** بشكل تكراري والادله على اتصال الملف. * @param File (file or directory) for touching. @ * المعلمه الملف (ملف أو دليل (للمس. */ public static void touch(File file, long time) { if(file.isDirectory()) for(File childFile:file.listFiles()) touch(childFile, time); file.setLastModified(time); } } * / ساكنة باطلة العامة على اتصال (ملف ملف ، منذ وقت طويل) (اذا (file.isdirectory ()) ل(ملف childfile : file.listfiles ()) على اتصال (childfile الوقت) ؛ file.setlastmodified (الوقت) ؛))
You can also download the يمكنك ايضا تنزيل java executable class file ملف قابل للتنفيذ من الدرجة جافا . You can run it as follows: يمكنك ان تنشئ على النحو التالي :
java -classpath . جافا - classpath. Touch *.html لغة تأشير النص الفائق على اتصال *.
Replace *.html with file name(s) and directories you want to update. *. تحل محل لغة تأشير النص الفائق مع اسم الملف (ق) والادله التي تريد التحديث. This requires JDK 1.5 or later. وهذا يتطلب 1،5 جدك] او في وقت لاحق.
Filed under المقدم بمقتضى Headline News أهم الانباء , ، How To كيف , ، Java Software برنامج جافا , ، Tech Note ملاحظه تقنيه | |
| |
RSS 2.0 ار اس اس 2،0 | |
Trackback this Article | هذه المادة |
Email this Article ارسل هذه المادة
You may also like to read ويمكنك ايضا ان تقرأ |




































March 17th, 2007 at 7:13 am مارس 17th ، 2007 في الساعة 7:13
There’sa problem with the recursinion in the touch method. ان هناك مشكلة مع اتصال recursinion في طريقه.
This line: هذا الخط :
if(file.isDirectory()) for(File childFile:file.listFiles()) touch(file, time); اذا كانت الاجابه ب (file.isdirectory ()) ل(ملف childfile : file.listfiles ()) على اتصال (ملف الوقت) ؛
should be: ينبغي ان يكون :
if(file.isDirectory()) for(File childFile:file.listFiles()) touch(childFile, time); اذا كانت الاجابه ب (file.isdirectory ()) ل(ملف childfile : file.listfiles ()) على اتصال (childfile الوقت) ؛
July 5th, 2007 at 8:00 am الخامس من يوليو المقبل ، 2007 فى الساعة 8:00 صباحا
Thanks. شكرا. Corrected. تصحيحها.
November 27th, 2007 at 1:29 pm تشرين الثاني / نوفمبر 27th ، 2007 في الساعة 1:29
Thanks for this little utility! شكرا لهذا فائدة تذكر!
It would be nice if you could also correct the class file.. وسيكون من نيس ويمكن ايضا اذا كنت تصحيح الدرجة الملف..