package net.sourceforge.javautil.common.dsl;
import java.io.File;
import net.sourceforge.javautil.common.io.impl.ISystemArtifact;
import net.sourceforge.javautil.common.io.impl.SystemDirectory;
import net.sourceforge.javautil.common.io.impl.SystemFile;
/**
* DSL methods related to {@link File}'s and related operations.
*
* @author elponderador
* @author $Author: ponderator $
* @version $Id: FileDSL.java 2297 2010-06-16 00:13:14Z ponderator $
*/
public class FileDSL {
/**
* @param name The name/path of a file
* @return A file wrapper object
*/
public static File toFile (String name) { return new File(name); }
/**
* @param file The file for which a {@link ISystemArtifact} is desired
* @return A valid system artifact wrapper
*/
public static ISystemArtifact toSystem (File file) { return file.isDirectory() ? new SystemDirectory(file) : new SystemFile(file); }
}