Package java.io

Examples of java.io.File.canRead()


        }
        if (dirname.equals("")) {
          return new LogisimFileChooser();
        } else {
          File dir = new File(dirname);
          if (dir.canRead()) {
            return new LogisimFileChooser(dir);
          }
        }
      } catch (RuntimeException t) {
        if (first == null) first = t;
View Full Code Here


          aFileType = "d";
        else if (aFile.isFile())
          aFileType = "-";
        else
          aFileType = "?";
        String aFileRead = (aFile.canRead() ? "r" : "-");
        String aFileWrite = (aFile.canWrite() ? "w" : "-");
        String aFileExe = "-";
        if (canExecute != null)
          try {
            if (((Boolean) canExecute.invoke(aFile, Utils.EMPTY_OBJECTS)).booleanValue())
View Full Code Here

      throws IOException {

  List<QueryTest> queries = null;
//  Map<String, Object> queries = new HashMap<String, Object>();
  File queryFile = new File(queryFileName);
  if (!queryFile.exists() || !queryFile.canRead()) {
      String msg = "Query file doesn't exist or cannot be read: " + queryFileName + ", ignoring and continuing";
      TestLogger.log(msg);
      throw new TransactionRuntimeException(msg); //$NON-NLS-1$ //$NON-NLS-2$
  }
      // Get query set name
View Full Code Here

    if (in != null)
    {
      return in;
    }
    final File f = new File(name);
    if (f.canRead())
    {
      return f.toURL();
    }
    return null;
  }
View Full Code Here

        File fca = new File(fcaPath);
        if (!fca.exists()) {
            fcaPath = path + "/fca.";
            fca = new File(fcaPath);
        }
        if (!fca.canRead()) {
            println("");
            return null;
        }
        try {
            DcwRecordFile fcadesc = new DcwRecordFile(fcaPath);
View Full Code Here

    {
      return urlFromConfig;
    }

    final File localFile = new File("jlfgr-1_0.jar");
    if (localFile.exists() && localFile.canRead() && localFile.isFile())
    {
      try
      {
        return localFile.toURL();
      }
View Full Code Here

    }

    final File classpathFile = findFileOnClassPath("jlfgr-1_0.jar");
    if (classpathFile != null)
    {
      if (classpathFile.exists() && classpathFile.canRead() && classpathFile.isFile())
      {
        try
        {
          return classpathFile.toURL();
        }
View Full Code Here

    try
    {
      if (o instanceof File)
      {
        final File f = (File) o;
        if (f.canRead())
        {
          return f.toURL();
        }
      }
      else if (o instanceof String)
View Full Code Here

 
  public synchronized void start(PrintStream out) throws IOException
  {
    if (_server == null) {
      File source = _configGen;
      if (!source.exists() || !source.canRead()) {
        source = _config;
     
      out.println("server starting up: "+source);
      ConfigReader reader = new ConfigReader(this, source);
      Server server = reader.parse();
View Full Code Here

    {
      throw new IllegalArgumentException("The give path is not valid."); //$NON-NLS-1$
    }

    final File target = new File(baseDirectory, configPath);
    return target.exists() && target.canRead();
  }

  public String toString()
  {
    return "FileConfigStorage={baseDir=" + baseDirectory + '}'; //$NON-NLS-1$ //$NON-NLS-2$
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.