Java 类org.gradle.api.PathValidation 实例源码

项目:Reer    文件:AbstractFileResolver.java   
public NotationParser<Object, File> asNotationParser() {
    return new NotationParser<Object, File>() {
        public File parseNotation(Object notation) throws UnsupportedNotationException {
            // TODO Further differentiate between unsupported notation errors and others (particularly when we remove the deprecated 'notation.toString()' resolution)
            return resolve(notation, PathValidation.NONE);
        }

        @Override
        public void describe(DiagnosticsVisitor visitor) {
            visitor.candidate("Anything that can be converted to a file, as per Project.file()");
        }
    };
}
项目:Reer    文件:AbstractFileResolver.java   
protected void validate(File file, PathValidation validation) {
    switch (validation) {
        case NONE:
            break;
        case EXISTS:
            if (!file.exists()) {
                throw new InvalidUserDataException(String.format("File '%s' does not exist.", file));
            }
            break;
        case FILE:
            if (!file.exists()) {
                throw new InvalidUserDataException(String.format("File '%s' does not exist.", file));
            }
            if (!file.isFile()) {
                throw new InvalidUserDataException(String.format("File '%s' is not a file.", file));
            }
            break;
        case DIRECTORY:
            if (!file.exists()) {
                throw new InvalidUserDataException(String.format("Directory '%s' does not exist.", file));
            }
            if (!file.isDirectory()) {
                throw new InvalidUserDataException(String.format("Directory '%s' is not a directory.", file));
            }
            break;
    }
}
项目:Pushjet-Android    文件:AbstractFileResolver.java   
public NotationParser<Object, File> asNotationParser() {
    return new NotationParser<Object, File>() {
        public File parseNotation(Object notation) throws UnsupportedNotationException {
            // TODO Further differentiate between unsupported notation errors and others (particularly when we remove the deprecated 'notation.toString()' resolution)
            return resolve(notation, PathValidation.NONE);
        }

        public void describe(Collection<String> candidateFormats) {
            candidateFormats.add("Anything that can be converted to a file, as per Project.file()");
        }
    };
}
项目:Pushjet-Android    文件:AbstractFileResolver.java   
protected void validate(File file, PathValidation validation) {
    switch (validation) {
        case NONE:
            break;
        case EXISTS:
            if (!file.exists()) {
                throw new InvalidUserDataException(String.format("File '%s' does not exist.", file));
            }
            break;
        case FILE:
            if (!file.exists()) {
                throw new InvalidUserDataException(String.format("File '%s' does not exist.", file));
            }
            if (!file.isFile()) {
                throw new InvalidUserDataException(String.format("File '%s' is not a file.", file));
            }
            break;
        case DIRECTORY:
            if (!file.exists()) {
                throw new InvalidUserDataException(String.format("Directory '%s' does not exist.", file));
            }
            if (!file.isDirectory()) {
                throw new InvalidUserDataException(String.format("Directory '%s' is not a directory.", file));
            }
            break;
    }
}
项目:Pushjet-Android    文件:AbstractFileResolver.java   
public NotationParser<Object, File> asNotationParser() {
    return new NotationParser<Object, File>() {
        public File parseNotation(Object notation) throws UnsupportedNotationException {
            // TODO Further differentiate between unsupported notation errors and others (particularly when we remove the deprecated 'notation.toString()' resolution)
            return resolve(notation, PathValidation.NONE);
        }

        public void describe(Collection<String> candidateFormats) {
            candidateFormats.add("Anything that can be converted to a file, as per Project.file()");
        }
    };
}
项目:Pushjet-Android    文件:AbstractFileResolver.java   
protected void validate(File file, PathValidation validation) {
    switch (validation) {
        case NONE:
            break;
        case EXISTS:
            if (!file.exists()) {
                throw new InvalidUserDataException(String.format("File '%s' does not exist.", file));
            }
            break;
        case FILE:
            if (!file.exists()) {
                throw new InvalidUserDataException(String.format("File '%s' does not exist.", file));
            }
            if (!file.isFile()) {
                throw new InvalidUserDataException(String.format("File '%s' is not a file.", file));
            }
            break;
        case DIRECTORY:
            if (!file.exists()) {
                throw new InvalidUserDataException(String.format("Directory '%s' does not exist.", file));
            }
            if (!file.isDirectory()) {
                throw new InvalidUserDataException(String.format("Directory '%s' is not a directory.", file));
            }
            break;
    }
}
项目:Reer    文件:DefaultProject.java   
public File file(Object path, PathValidation validation) {
    return getFileOperations().file(path, validation);
}
项目:Reer    文件:AbstractFileResolver.java   
public File resolve(Object path) {
    return resolve(path, PathValidation.NONE);
}
项目:Reer    文件:DefaultFileOperations.java   
public File file(Object path, PathValidation validation) {
    return fileResolver.resolve(path, validation);
}
项目:Reer    文件:DefaultScript.java   
@Override
public File file(Object path, PathValidation validation) {
    return fileOperations.file(path, validation);
}
项目:Pushjet-Android    文件:AbstractFileResolver.java   
public File resolve(Object path) {
    return resolve(path, PathValidation.NONE);
}
项目:Pushjet-Android    文件:DefaultFileOperations.java   
public File file(Object path, PathValidation validation) {
    return fileResolver.resolve(path, validation);
}
项目:Pushjet-Android    文件:DefaultScript.java   
public File file(Object path, PathValidation validation) {
    return fileOperations.file(path, validation);
}
项目:Pushjet-Android    文件:AbstractFileResolver.java   
public File resolve(Object path) {
    return resolve(path, PathValidation.NONE);
}
项目:Pushjet-Android    文件:DefaultFileOperations.java   
public File file(Object path, PathValidation validation) {
    return fileResolver.resolve(path, validation);
}
项目:Pushjet-Android    文件:DefaultScript.java   
public File file(Object path, PathValidation validation) {
    return fileOperations.file(path, validation);
}
项目:gradle-pylizard    文件:MockSourceSet.java   
@Override
public File resolve(final Object path, final PathValidation validation) {
    return resolve(path);
}
项目:Reer    文件:AbstractFileResolver.java   
public File resolve(Object path, PathValidation validation) {
    File file = doResolve(path);

    file = fileNormaliser.normalise(file);

    validate(file, validation);

    return file;
}
项目:Pushjet-Android    文件:AbstractFileResolver.java   
public File resolve(Object path, PathValidation validation) {
    File file = doResolve(path);

    file = normalise(file);

    validate(file, validation);

    return file;
}
项目:Pushjet-Android    文件:AbstractFileResolver.java   
public File resolve(Object path, PathValidation validation) {
    File file = doResolve(path);

    file = normalise(file);

    validate(file, validation);

    return file;
}
项目:Reer    文件:FileOperations.java   
File file(Object path, PathValidation validation);
项目:Reer    文件:FileResolver.java   
File resolve(Object path, PathValidation validation);
项目:Pushjet-Android    文件:FileOperations.java   
File file(Object path, PathValidation validation);
项目:Pushjet-Android    文件:FileResolver.java   
File resolve(Object path, PathValidation validation);
项目:Pushjet-Android    文件:FileOperations.java   
File file(Object path, PathValidation validation);
项目:Pushjet-Android    文件:FileResolver.java   
File resolve(Object path, PathValidation validation);