2 * Copyright 2004-2008 the Seasar Foundation and the Others.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
\r
13 * either express or implied. See the License for the specific language
\r
14 * governing permissions and limitations under the License.
\r
16 package org.seasar.extension.jdbc.gen.internal.argtype;
\r
18 import java.io.File;
\r
20 import org.seasar.extension.jdbc.gen.internal.util.ArgumentUtil;
\r
21 import org.seasar.extension.jdbc.gen.internal.util.FileUtil;
\r
22 import org.seasar.framework.util.StringUtil;
\r
25 * {@link File}を扱う{@link ArgumentType}の実装クラスです。
\r
29 public class FileType implements ArgumentType<File> {
\r
31 public File toObject(String value) {
\r
32 if (StringUtil.isEmpty(value)) {
\r
35 String s = ArgumentUtil.decode(value);
\r
39 public String toText(File value) {
\r
40 if (value == null) {
\r
43 String path = FileUtil.getCanonicalPath(value);
\r
44 return ArgumentUtil.encode(path);
\r