Package java.io

Examples of java.io.File.canRead()


  }

  public boolean load(String fileName) {
    if (fileName != null) {
      File file = new File(fileName);
      if (!file.canRead())
        return false;// fail while opening the file

      try {
        DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
View Full Code Here


   * @return
   */
  public boolean load(String fileName) {
    int i = 0, j = 0;
    File file = new File(fileName);
    if (!file.canRead())
      return false;// fail while opening the file

    try {
      long offset = 0;
      WordTable wt = new WordTable();
View Full Code Here

  }

  public boolean load(String fileName, boolean isReset) {
    if (fileName != null) {
      File file = new File(fileName);
      if (!file.canRead())
        return false;// fail while opening the file

      try {
        DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
        // ��ȡ����
View Full Code Here

    if(!zoneDir.exists() || !zoneDir.isDirectory()){

      log.error("Zone file directory specified for FileZoneProvider " + name + " does not exist!");
      return null;

    }else if(!zoneDir.canRead()){

      log.error("Zone file directory specified for FileZoneProvider " + name + " is not readable!");
      return null;
    }
View Full Code Here

  public List getValues(HttpServletRequest request) {
    File dir = new File(new File(ContextHolder.getContext().getConfDirectory(), "site"), "icons");
    List l = new ArrayList();
    l.add(new Pair("default", "Default"));
    if(dir.exists() && dir.canRead()) {
      String[] names = dir.list();
      for(int i = 0 ; i < names.length; i++) {
        l.add(new Pair(names[i], names[i]));
      }
    }
View Full Code Here

                    "config.properties->junit.formats.directory should be a readable directory. ");
        }
        File[] files = directory.listFiles(new AudioFileFilter());
        for (int i = 0; i < files.length; i++) {
            File current = files[i];
            if (current.isFile() && current.canRead()) {
                return current;
            }
        }
    return null; // no file found
    }
View Full Code Here

        String directroy = Configuration.getProperty("junit.format.directory");
        File file = new File(directroy);
        Assert
                .assertTrue(
                        "Please check \"entagged.junit.resource.config.properties\" for valid values",
                        file.exists() && file.isDirectory() && file.canRead());
    }

    /**
     * Creates a suite with all Tests.
     *
 
View Full Code Here

                    "config.properties->junit.formats.directory should be a readable directory. ");
        }
        File[] files = directory.listFiles(new AudioFileFilter());
        for (int i = 0; i < files.length; i++) {
            File current = files[i];
            if (current.isFile() && current.canRead()) {
                File copy = Utils.createCopy(current);
                this.copies.add(copy);
                if (asfTest == null && copy.getName().endsWith("wma")) {
                    this.asfTest = new AsfConstraintTest(copy);
                    this.addTest(asfTest);
View Full Code Here

            }
        }
        if (!queueDir.isDirectory()) {
            throw new ServletException("Message queue directory appears to not be a directory.");
        }
        if (!queueDir.canWrite() || !queueDir.canRead()) {
            throw new ServletException("Message queue directory " + queueDir.getAbsolutePath() + " has incorret permissions.");
        }
        try {
            notifier = new Notifier(queueDir);
        } catch (IOException e2) {
View Full Code Here

  public static boolean isReadable(String url) {

    File file = new File(url);

    if (file.exists() && file.canRead()) {
      return true;
    }
    return false;

  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.