Package java.io

Examples of java.io.File.canRead()


  public File[] browseBackward() {
    if (history.size() > 1 && !isLocked()) {
      history.remove(history.size() - 1); // remove
      // current
      File destination = (File) history.get(history.size() - 1);
      if (destination.exists() && destination.canRead()) {
        return setDirectory(destination,
            NavigatorListener.EVENT_BACKWARD);
      }
    }
    return null;
View Full Code Here


   * This method changes the current location to the parent of the currrent
   * directory.
   */
  public void browseToParent() {
    File dest = getCurrentFolder().getParentFile();
    if (dest != null && dest.isDirectory() && dest.canRead()) {
      setDirectory(dest, NavigatorListener.EVENT_PARENT);
    }
  }

  /**
 
View Full Code Here

   */
  private File findAlternative() {
    File[] roots = File.listRoots();
    for (int i = 0; i < roots.length; i++) {
      File current = roots[i];
      if (current != null && current.exists() && current.canRead()
          && current.isDirectory()) {
        return current;
      }
    }
    JFileChooser chooser = new JFileChooser();
View Full Code Here

  public void restoreSettings() {
    String workDir = PreferencesManager
        .get("tageditor.tageditorframe.workingdir");
    if (workDir != null) {
      File file = new File(workDir);
      if (file.exists() && file.isDirectory() && file.canRead()) {
        setDirectory(file, NavigatorListener.EVENT_JUMPED);
        return;
      }
    }
    setDirectory(findAlternative(), NavigatorListener.EVENT_JUMPED);
View Full Code Here

            jLabelIndexFeature.setIcon(ResourcesRepository.getImageIcon("yes.gif"));
          }
          /*JScrollBar JB = tableScrollPane.getHorizontalScrollBar();
          System.out.println(JB.getValue());*/
          File dest = new File(dirChooser.getPath());
          if (dest != null && dest.isDirectory() && dest.canRead())
            navigator.reload();
          navigator.fireDirectoryChange(NavigatorListener.EVENT_RELOAD);
         

        }
View Full Code Here

        keyStoreEmpty = true;
        keyStore = null;
        try {
            File keystoreFile = getKeyStoreFile();
            InputStream in = null;
            if (keystoreFile.exists() && keystoreFile.canRead()) {
                keyStoreExists = true;
                keyStoreException = null;
                keyStoreEmpty = true;
                keyStore = null;
                try {
View Full Code Here

     */
    public void checkKeyStore() {
        initKeyStoreFile();
        try {
            File keystoreFile = getKeyStoreFile();
            if (keystoreFile.exists() && keystoreFile.canRead()) {
                Date fileLastModified = new Date(keystoreFile.lastModified());
                if (keystoreLastModified == null || !keystoreLastModified.equals(fileLastModified)) {
                    keystoreLastModified = fileLastModified;
                    reloadKeystore();
                } else {
View Full Code Here

    File file;

    int[] nBuffer = new int[3];

    file = new File(filename);
    if (!file.canRead())
      return false;// fail while opening the file

    try {
      delModified();
View Full Code Here

                }
            }
            else
            {
                File config = new File(path, PLUGIN_CONFIG_RESOURCE);
                if (config.exists() && config.canRead())
                {
                    try
                    {
                      configure(config.toURL());
                    }
View Full Code Here

    File file;

    int[] nBuffer = new int[3];

    file = new File(fileName);
    if (!file.canRead())
      return false;// fail while opening the file

    int i=0,j=0;
    try {
      DataInputStream in = new DataInputStream(new FileInputStream(file));
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.