[Swift-commit] r3429 - trunk/src/org/griphyn/vdl/mapping/file
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Wed Jul 7 15:20:19 CDT 2010
Author: wozniak
Date: 2010-07-07 15:20:19 -0500 (Wed, 07 Jul 2010)
New Revision: 3429
Modified:
trunk/src/org/griphyn/vdl/mapping/file/CSVMapper.java
Log:
Follow-up bug fix to CSVMapper
Modified: trunk/src/org/griphyn/vdl/mapping/file/CSVMapper.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/file/CSVMapper.java 2010-07-06 21:54:12 UTC (rev 3428)
+++ trunk/src/org/griphyn/vdl/mapping/file/CSVMapper.java 2010-07-07 20:20:19 UTC (rev 3429)
@@ -21,6 +21,7 @@
import org.griphyn.vdl.mapping.MappingParam;
import org.griphyn.vdl.mapping.Path;
import org.griphyn.vdl.mapping.PhysicalFormat;
+import org.griphyn.vdl.type.Types;
public class CSVMapper extends AbstractMapper {
public static final MappingParam PARAM_FILE = new MappingParam("file");
@@ -133,10 +134,16 @@
String result = null;
Object object = PARAM_FILE.getRawValue(this);
DSHandle handle = (DSHandle) object;
- Mapper mapper = handle.getMapper();
- PhysicalFormat format = mapper.map(Path.EMPTY_PATH);
- GeneralizedFileFormat fileFormat =
- (GeneralizedFileFormat) format;
+ GeneralizedFileFormat fileFormat;
+ if (handle.getType().equals(Types.STRING)) {
+ String path = (String) handle.getValue();
+ fileFormat = new AbsFile(path);
+ }
+ else {
+ Mapper mapper = handle.getMapper();
+ PhysicalFormat format = mapper.map(Path.EMPTY_PATH);
+ fileFormat = (GeneralizedFileFormat) format;
+ }
result = fileFormat.getPath();
return result;
}
More information about the Swift-commit
mailing list