Revision | 9873f63135cc66bf050a7101e8d60ae88e46b617 (tree) |
---|---|
Time | 2018-01-08 18:17:48 |
Author | shupeluter@hotmail.com <shupeluter@hotm...> |
Commiter | shupeluter@hotmail.com |
テストデータを作成
@@ -1,27 +0,0 @@ | ||
1 | -/* | |
2 | - * To change this license header, choose License Headers in Project Properties. | |
3 | - * To change this template file, choose Tools | Templates | |
4 | - * and open the template in the editor. | |
5 | - */ | |
6 | -package jp.co.nec.jsight.filecleaner; | |
7 | - | |
8 | -import java.io.File; | |
9 | -import java.util.List; | |
10 | -import org.stux.common.exception.StuxBasicException; | |
11 | -/** | |
12 | - * | |
13 | - * @author shupe | |
14 | - */ | |
15 | -public class FileCleaner { | |
16 | - | |
17 | - public static void clean(File file) throws StuxBasicException{ | |
18 | - FileObjectScanner fos = new FileObjectScanner(file); | |
19 | - List<File> targets =fos.getFiles(); | |
20 | - | |
21 | - for(File tfile:targets){ | |
22 | - | |
23 | - } | |
24 | - | |
25 | - } | |
26 | - | |
27 | -} |
@@ -0,0 +1,53 @@ | ||
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | +package jp.co.nec.jsight.filecleaner; | |
7 | + | |
8 | +import java.io.File; | |
9 | +import java.util.HashMap; | |
10 | +import java.util.List; | |
11 | +import java.util.Map; | |
12 | +import java.util.Map.Entry; | |
13 | +import java.util.logging.Level; | |
14 | +import java.util.logging.Logger; | |
15 | +import org.stux.common.exception.StuxBasicException; | |
16 | +/** | |
17 | + * | |
18 | + * @author shupe | |
19 | + */ | |
20 | +public class FileCleanerManager{ | |
21 | + private List<Map.Entry> cleanerList; | |
22 | + private List<Map.Entry> repList; | |
23 | + private Map<String,IBasicFileCleaner> cleaners; | |
24 | + | |
25 | + | |
26 | + public FileCleanerManager() { | |
27 | + ReplaceInfoManager rim = new ReplaceInfoManager(); | |
28 | + repList = rim.getReplaceStrs(); | |
29 | + cleanerList = rim.getReplacerStrs(); | |
30 | + | |
31 | + } | |
32 | + | |
33 | + public Map<String,IBasicFileCleaner> createCleaners(){ | |
34 | + Map<String,IBasicFileCleaner> result = new HashMap(); | |
35 | + for(Entry<String,String> entry:cleanerList){ | |
36 | + try { | |
37 | + Class cleaner = Class.forName(entry.getValue()); | |
38 | + IBasicFileCleaner fileCleaner = (IBasicFileCleaner) cleaner.newInstance(); | |
39 | + result.put(entry.getKey(),fileCleaner); | |
40 | + } catch (ClassNotFoundException ex) { | |
41 | + Logger.getLogger(FileCleanerManager.class.getName()).log(Level.SEVERE, null, ex); | |
42 | + } catch (InstantiationException ex) { | |
43 | + Logger.getLogger(FileCleanerManager.class.getName()).log(Level.SEVERE, null, ex); | |
44 | + } catch (IllegalAccessException ex) { | |
45 | + Logger.getLogger(FileCleanerManager.class.getName()).log(Level.SEVERE, null, ex); | |
46 | + } | |
47 | + } | |
48 | + return result; | |
49 | + }; | |
50 | + | |
51 | + | |
52 | + | |
53 | +} |
@@ -1 +1,5 @@ | ||
1 | - | |
1 | +; | |
2 | +;xx | |
3 | +; | |
4 | +; | |
5 | +;xxx |
@@ -1 +1,11 @@ | ||
1 | - | |
1 | +;;; | |
2 | +;;; | |
3 | +;;; | |
4 | +;;; | |
5 | +;;; | |
6 | +;;; | |
7 | +;;; | |
8 | +;;; | |
9 | +;;; | |
10 | +;;; | |
11 | +;;;aaa |
@@ -1 +1,12 @@ | ||
1 | - | |
1 | +;;; | |
2 | +;;; | |
3 | +;;; | |
4 | +;;; | |
5 | +;;; | |
6 | +;;; | |
7 | +;;; | |
8 | +;;; | |
9 | +;;; | |
10 | +;;; | |
11 | +;;; | |
12 | +;;;a |
@@ -1 +1,22 @@ | ||
1 | - | |
1 | +;;;; | |
2 | +;;;; | |
3 | +;;;; | |
4 | +;;;; | |
5 | +;;;; | |
6 | +;;;; | |
7 | +;;;; | |
8 | +;;;; | |
9 | +;;;; | |
10 | +;;;; | |
11 | +;;;; | |
12 | +;;;; | |
13 | +;;;; | |
14 | +;;;; | |
15 | +;;;; | |
16 | +;;;; | |
17 | +;;;; | |
18 | +;;;; | |
19 | +;;;; | |
20 | +;;;; | |
21 | +;;;; | |
22 | +;;;;aaa |
@@ -1 +1,4 @@ | ||
1 | - | |
1 | +;;;;;;;;;;;;;; | |
2 | +××証券;;;;;;;;;;;;;; | |
3 | +;;;;;;;;;;;;;; | |
4 | +;;;;;;;;;;;;;;xx |
@@ -1 +1,8 @@ | ||
1 | - | |
1 | +;;;; | |
2 | +;;;; | |
3 | +;;;; | |
4 | +;;;; | |
5 | +;;;; | |
6 | +;;;; | |
7 | +;;;zzzz;"aaaaaaaaaaaaaa | |
8 | +xx証券" |