Java Folder Read getFileStatus(File file)

Here you can find the source of getFileStatus(File file)

Description

get File Status

License

Apache License

Declaration

public static String getFileStatus(File file) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

public class Main {
    public static final String FILE_STATUS_HIDDEN = "H";
    public static final String FILE_STATUS_CAN_READ = "R";
    public static final String FILE_STATUS_CAN_WRITE = "W";

    public static String getFileStatus(File file) {
        StringBuffer buffer = new StringBuffer();

        buffer.append(file.isHidden() ? FILE_STATUS_HIDDEN + "\t" : "\t");
        buffer.append(file.canRead() ? FILE_STATUS_CAN_READ + "\t" : "\t");
        buffer.append(file.canWrite() ? FILE_STATUS_CAN_WRITE + "\t" : "\t");

        return buffer.toString();
    }//from   w  w w .  ja  va  2  s . c  o m
}

Related

  1. getFilesOfDirectory(File directory)
  2. getFilesOfTypeInDirectory(File directory, String filetype)
  3. getFilesRegex(final File root, final String[] regex)
  4. getFilesStartingWith(File parentDir, String prefix)
  5. getFilesStartingWith(String dirName, String startsWith)
  6. getFileString(File file)
  7. getFileString(String filePath)
  8. getFileStringContent(String filename)
  9. GetFilesWithChildren(File root, ArrayList files)