Examples of canRead()


Examples of java.io.File.canRead()

    * and in ./cluster
    * @exception IllegalArgumentException if you are in the wrong directory
    */
   private String findPropertyFile(String fn) {
      File f = new File(fn);
      if (f.canRead())
         return fn;
      f = new File("cluster" + File.separatorChar + fn);
      if (f.canRead())
         return f.getPath();
      log.severe("Can't locate property file " + fn + ". Please check your current directory or cluster directory");
View Full Code Here

Examples of java.io.File.canRead()

   private String findPropertyFile(String fn) {
      File f = new File(fn);
      if (f.canRead())
         return fn;
      f = new File("cluster" + File.separatorChar + fn);
      if (f.canRead())
         return f.getPath();
      log.severe("Can't locate property file " + fn + ". Please check your current directory or cluster directory");
      throw new IllegalArgumentException("Can't locate property file " + fn + ". Please check your current directory or cluster directory");
   }
View Full Code Here

Examples of java.io.File.canRead()

      }
    }
    else if (!dataDir.isDirectory()) {
      throw new StoreException("The specified path does not denote a directory: " + dataDir);
    }
    else if (!dataDir.canRead()) {
      throw new StoreException("Not allowed to read from the specified directory: " + dataDir);
    }

    // try to lock the directory or fail
    dirLock = new DirectoryLockManager(dataDir).lockOrFail();
View Full Code Here

Examples of java.io.File.canRead()

        if(post != null) {
          if(post.containsKey("defaultFile")){
              // TODO check file-path!
              final File value = new File(sb.getAppPath(), post.get("defaultFile", "defaults/yacy.init"));
              // check if value is readable file
              if(value.exists() && value.isFile() && value.canRead()) {
                  defaultSettingsFile = value;
              }
          }
            if (post.containsKey("Xmx")) {
                int xmx = post.getInt("Xmx", 500); // default maximum heap size
View Full Code Here

Examples of java.io.File.canRead()

         log.warning("the filename '" + filename + "' is absolute, I will ignore the given search path '" + path + "'");
         if (file.exists()) {
            if (file.isDirectory()) {
               throw new XmlBlasterException(this.glob, ErrorCode.RESOURCE_CONFIGURATION, ME + ".findFile", "the given name '" + file.getAbsolutePath() + "' is a directory");
            }
            if (!file.canRead()) {
               throw new XmlBlasterException(this.glob, ErrorCode.RESOURCE_CONFIGURATION, ME + ".findFile", "don't have the rights to read the file '" + file.getAbsolutePath() + "'");
            }
            return file.getAbsolutePath();
         }
      }
View Full Code Here

Examples of java.io.File.canRead()

         if (tmp.exists()) {
            if (tmp.isDirectory()) {
               ex = new XmlBlasterException(this.glob, ErrorCode.RESOURCE_CONFIGURATION, ME + ".findFile", "the given name '" + tmp.getAbsolutePath() + "' is a directory");
            }
            else {
               if (!tmp.canRead()) {
                  ex = new XmlBlasterException(this.glob, ErrorCode.RESOURCE_CONFIGURATION, ME + ".findFile", "don't have the rights to read the file '" + tmp.getAbsolutePath() + "'");
               }
               else return tmp.getAbsolutePath();
            }
         }
View Full Code Here

Examples of java.io.File.canRead()

      if (file.exists()) {
         if (file.isDirectory()) {
            log.warning("findFileInSinglePath: the given name '" + file.getAbsolutePath() + "' is not a file, it is a directory");
            return null;
         }
         if (!file.canRead()) {
            log.warning("findFileInSinglePath: don't have the rights to read the file '" + file.getAbsolutePath() + "'");
            return null;
         }
         try {
            return file.toURL();
View Full Code Here

Examples of java.io.File.canRead()

    // Determine the mime-type
    String mimeType;
    try {
      File file = rawDocument.getContentAsFile();
      if (file.canRead() == false) {
        mLog.warn("canRead() on file return: false. Maybe no access rights for sourceURL: " +
          RegainToolkit.fileToUrl(file));
        return null;
      }
View Full Code Here

Examples of java.io.File.canRead()

      if (url.startsWith("file://")) {
        // file system: Check whether this is a directory
        try {
          File file = RegainToolkit.urlToFile(url);
          // Check whether the file is readable.
          if (!file.canRead()) {
            mCrawlerJobProfiler.abortMeasuring();
            mLog.debug("File rights: canRead: " + file.canRead() +
                    " canExecute: " + file.canExecute() +
                    " canWrite: " + file.canWrite() + " exists: " + file.exists() +
                    " for url: " + url + ", canonical url: " + file.getCanonicalPath());
View Full Code Here

Examples of java.io.File.canRead()

        try {
          File file = RegainToolkit.urlToFile(url);
          // Check whether the file is readable.
          if (!file.canRead()) {
            mCrawlerJobProfiler.abortMeasuring();
            mLog.debug("File rights: canRead: " + file.canRead() +
                    " canExecute: " + file.canExecute() +
                    " canWrite: " + file.canWrite() + " exists: " + file.exists() +
                    " for url: " + url + ", canonical url: " + file.getCanonicalPath());
            logError("File is not readable: '" + url + "'", null, false);
            continue;
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.