1 package com.wikihouse.wildcats0201.jdbcchart.fsutil; 2 3 import java.io.File; 4 5 /*** 6 * <B>PathFactory </B>. PathのFactoryです。 7 * 8 * @author $Author: wildcats $ 9 * @version $Revision: 5 $ 10 */ 11 public final class PathFactory { 12 13 private PathFactory() { 14 } 15 16 /*** 17 * 生成 18 * 19 * @param path 20 * パス名 21 * @return パス 22 */ 23 public static Path create(String path) { 24 return new PathImpl(path); 25 } 26 27 private static class PathImpl implements Path { 28 29 private final String location; 30 31 public PathImpl(String location) { 32 if (location.endsWith(File.separator)) { 33 this.location = location; 34 } else { 35 this.location = new StringBuffer(location).append( 36 File.separatorChar).toString(); 37 } 38 } 39 40 public String getPath() { 41 return this.location; 42 } 43 44 } 45 46 }