Java Code Examples for org.gradle.internal.nativeintegration.filesystem.FileSystem

The following examples show how to use org.gradle.internal.nativeintegration.filesystem.FileSystem. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public int getUnixMode(File f) throws IOException {
    if (f.isDirectory()) {
        return FileSystem.DEFAULT_DIR_MODE;
    } else if (f.exists()) {
        return FileSystem.DEFAULT_FILE_MODE;
    } else {
        throw new FileNotFoundException(String.format("File '%s' not found.", f));
    }
}
 
Example 2
public int getMode() {
    int unixMode = entry.getUnixMode() & 0777;
    if(unixMode == 0){
        //no mode infos available - fall back to defaults
        if(isDirectory()){
            unixMode = FileSystem.DEFAULT_DIR_MODE;
        }else{
            unixMode = FileSystem.DEFAULT_FILE_MODE;
        }
    }
    return unixMode;
}
 
Example 3
public static NotationParser<Object, Object> create(FileSystem fileSystem) {
    return NotationParserBuilder
            .toType(Object.class)
            .typeDisplayName("a File or URI")
            .converter(new FileOrUriNotationParser(fileSystem))
            .toComposite();
}
 
Example 4
Source Project: gradle-plugins   Source File: CompressFileOperationsImpl.java    License: MIT License 5 votes vote down vote up
public CompressFileOperationsImpl(ProjectInternal project) {
    fileOperations = project.getFileOperations();

    temporaryFileProvider = project.getServices().get(TemporaryFileProvider.class);
    fileHasher = project.getServices().get(FileHasher.class);
    fileSystem = project.getServices().get(FileSystem.class);
    directoryFileTreeFactory = project.getServices().get(DirectoryFileTreeFactory.class);
    patternSetFactory = project.getServices().getFactory(PatternSet.class);
}
 
Example 5
Source Project: gradle-plugins   Source File: CompressFileOperationsImpl.java    License: MIT License 5 votes vote down vote up
public CompressFileOperationsImpl(ProjectInternal project) {
    fileOperations = project.getFileOperations();

    temporaryFileProvider = project.getServices().get(TemporaryFileProvider.class);
    fileHasher = project.getServices().get(FileHasher.class);
    fileSystem = project.getServices().get(FileSystem.class);
    directoryFileTreeFactory = project.getServices().get(DirectoryFileTreeFactory.class);
    patternSetFactory = project.getServices().getFactory(PatternSet.class);
}
 
Example 6
public int getUnixMode(File f) throws IOException {
    if (f.isDirectory()) {
        return FileSystem.DEFAULT_DIR_MODE;
    } else if (f.exists()) {
        return FileSystem.DEFAULT_FILE_MODE;
    } else {
        throw new FileNotFoundException(String.format("File '%s' not found.", f));
    }
}
 
Example 7
public int getMode() {
    int unixMode = entry.getUnixMode() & 0777;
    if(unixMode == 0){
        //no mode infos available - fall back to defaults
        if(isDirectory()){
            unixMode = FileSystem.DEFAULT_DIR_MODE;
        }else{
            unixMode = FileSystem.DEFAULT_FILE_MODE;
        }
    }
    return unixMode;
}
 
Example 8
public static NotationParser<Object, Object> create(FileSystem fileSystem) {
    return NotationParserBuilder
            .toType(Object.class)
            .typeDisplayName("a File or URI")
            .converter(new FileOrUriNotationParser(fileSystem))
            .toComposite();
}
 
Example 9
Source Project: pushfish-android   Source File: TestFile.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void createLink(String target) {
    NativeServices.getInstance().get(FileSystem.class).createSymbolicLink(this, new File(target));
}
 
Example 10
protected AbstractFileResolver(FileSystem fileSystem) {
    this.fileSystem = fileSystem;
    this.fileNotationParser = FileOrUriNotationParser.create(fileSystem);
}
 
Example 11
public FileSystem getFileSystem() {
    return fileSystem;
}
 
Example 12
public DefaultFileLookup(FileSystem fileSystem) {
    this.fileSystem = fileSystem;
    fileResolver = new IdentityFileResolver(this.fileSystem);
}
 
Example 13
public FileSystem getFileSystem() {
    return fileSystem;
}
 
Example 14
public int getMode() {
    return isDirectory()
        ? FileSystem.DEFAULT_DIR_MODE
        : FileSystem.DEFAULT_FILE_MODE;
}
 
Example 15
public CopySpecActionImpl(CopyActionProcessingStreamAction action, Instantiator instantiator, FileSystem fileSystem) {
    this.action = action;
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
 
Example 16
public CopyFileVisitorImpl(CopySpecResolver spec, CopyActionProcessingStreamAction action, Instantiator instantiator, FileSystem fileSystem) {
    this.copySpecResolver = spec;
    this.action = action;
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
 
Example 17
public CopySpecBackedCopyActionProcessingStream(CopySpecInternal spec, Instantiator instantiator, FileSystem fileSystem) {
    this.spec = spec;
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
 
Example 18
public CopyActionExecuter(Instantiator instantiator, FileSystem fileSystem) {
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
 
Example 19
public FileOrUriNotationParser(FileSystem fileSystem) {
    this.fileSystem = fileSystem;
}
 
Example 20
public BaseDirFileResolver(FileSystem fileSystem, File baseDir) {
    super(fileSystem);
    assert baseDir.isAbsolute() : String.format("base dir '%s' is not an absolute file.", baseDir);
    this.baseDir = baseDir;
}
 
Example 21
public IdentityFileResolver(FileSystem fileSystem) {
    super(fileSystem);
}
 
Example 22
FileResolver createFileResolver(FileSystem fileSystem) {
    return new IdentityFileResolver(fileSystem);
}
 
Example 23
FileLookup createFileLookup(FileSystem fileSystem) {
    return new DefaultFileLookup(fileSystem);
}
 
Example 24
protected FileResolver createFileResolver() {
    return new BaseDirFileResolver(get(FileSystem.class), project.getProjectDir());
}
 
Example 25
protected FileResolver createFileResolver() {
    return new BaseDirFileResolver(get(FileSystem.class), settings.getSettingsDir());
}
 
Example 26
Source Project: DexKnifePlugin   Source File: ClassFileTreeElement.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public int getMode() {
    return isDirectory()
            ? FileSystem.DEFAULT_DIR_MODE
            : FileSystem.DEFAULT_FILE_MODE;
}
 
Example 27
Source Project: Pushjet-Android   Source File: TestFile.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void createLink(String target) {
    NativeServices.getInstance().get(FileSystem.class).createSymbolicLink(this, new File(target));
}
 
Example 28
protected AbstractFileResolver(FileSystem fileSystem) {
    this.fileSystem = fileSystem;
    this.fileNotationParser = FileOrUriNotationParser.create(fileSystem);
}
 
Example 29
public FileSystem getFileSystem() {
    return fileSystem;
}
 
Example 30
public DefaultFileLookup(FileSystem fileSystem) {
    this.fileSystem = fileSystem;
    fileResolver = new IdentityFileResolver(this.fileSystem);
}