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

The following examples show how to use org.gradle.internal.nativeintegration.filesystem.FileSystem#DEFAULT_FILE_MODE . 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
Source File: FallbackStat.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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
Source File: ZipFileTree.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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
Source File: FallbackStat.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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 4
Source File: ZipFileTree.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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 5
Source File: AbstractFileTreeElement.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public int getMode() {
    return isDirectory()
        ? FileSystem.DEFAULT_DIR_MODE
        : FileSystem.DEFAULT_FILE_MODE;
}
 
Example 6
Source File: ClassFileTreeElement.java    From DexKnifePlugin with 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 7
Source File: AbstractFileTreeElement.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public int getMode() {
    return isDirectory()
        ? FileSystem.DEFAULT_DIR_MODE
        : FileSystem.DEFAULT_FILE_MODE;
}