2017년 7월 30일 일요일

java readdir 자막변환

package com.timeline.smichanger;

import java.io.File;

public class SmiChange {

public static void main(String[] args) {
// TODO Auto-generated method stub
File folder = new File("C:/Users/jason/Downloads/DragonTV.Zhen.Huan.Zhuan.Complete.HDTV.720p.x264-CHDTV"); // com.timeline.smichanger

for (final File fileEntry : folder.listFiles()) {
       if (fileEntry.isDirectory()) {
           // listFilesForFolder(fileEntry);
       } else {
        if(fileEntry.getName().endsWith("smi")){
       
        if(fileEntry.getName().startsWith("후궁견환전")){
       
        String EpNo = (fileEntry.getName().replaceAll("후궁견환전, 2011 제", "")
        ).substring(0, 2);
       
        EpNo = "DragonTV.Zhen.Huan.Zhuan.Ep"+EpNo+".HDTV.720p.x264-CHDTV.smi";
        System.out.println(fileEntry.getName() + " : " + EpNo);
        String newName = folder.getAbsolutePath() +File.separator + EpNo;
        System.out.println(newName);
        File dest = new File(newName);
fileEntry.renameTo(dest );
        }
        }
         
       }
   }
}

}

댓글 없음:

댓글 쓰기

eclipse rcp dialog resize

  Dialog 안에 메소드를 만든다. private void autoResize(){     getShell().layout( true, true);     final Point newSize = getShell().computeSize...