Package com.alphacsp.cit

Examples of com.alphacsp.cit.FileValue


    private FileValue newFileValue(String path) {
        if (EnvironmentUtils.isCygwin()) {
            return new CygwinFileValue(path);
        } else {
            return new FileValue(path);
        }
    }
View Full Code Here


    public void execute(ExecutionContext executionContext) throws CommandExecutionException {
        Environment environment = executionContext.getEnvironment();
        List<String> parameters = executionContext.getParameters();

        FileValue pwd = environment.pwd();

        if (parameters.isEmpty()) {
            environment.cd();
        } else {
            String newFolder = parameters.get(0);
            FileValue newPwd = pwd.child(newFolder);
            File newFolderFile = newPwd.getAsFile();
            if (! newFolderFile.exists()) {
                throw new CommandExecutionException("No such directory: " + newFolderFile);
            }
            if (! newFolderFile.isDirectory()) {
                throw new CommandExecutionException(newFolderFile + "is not a directory");
View Full Code Here

    public String getDescription() {
        return "Print the current working directory";
    }

    public void execute(ExecutionContext context) throws CommandExecutionException {
        FileValue pwd = context.getEnvironment().pwd();
        context.println(pwd.getAsText(RenderHint.mixed));
    }
View Full Code Here

    public void execute(ExecutionContext context) throws CommandExecutionException {
        if (! context.getParameters().isEmpty()) {
            context.println("Sorry, parameters are not supported yet.");
            context.println();
        }
        FileValue fileValue = context.getEnvironment().pwd();
        File dir = fileValue.getAsFile();
        Assert.isTrue(dir.isDirectory());
        File[] files = dir.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return ! name.startsWith(".");
            }
View Full Code Here

        if (this.isPath()) {
            if (EnvironmentUtils.isCygwin()) {
                result = new CygwinFileValue(stringValue);
            } else {
                result = new FileValue(stringValue);
            }
        } else {
            return new VariableValue(stringValue);
        }
        return result;
View Full Code Here

TOP

Related Classes of com.alphacsp.cit.FileValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.