703 * We cann't update savedDir here now since it used very often
704 */
705 public void setDirectory(String dir) {
706
707 if (dir == null) {
708 this.dir = null;
709 return;
710 }
711
712 if (dir.equals(this.dir)) {
713 return;
714 }
715
716 int i;
717 if ((i=dir.indexOf("~")) != -1) {
718
719 dir = dir.substring(0,i) + System.getProperty("user.home") + dir.substring(i+1,dir.length());
720 }
721
722 File fe = new File(dir).getAbsoluteFile();
723 if (log.isLoggable(PlatformLogger.FINE)) {
724 log.fine("Current directory : " + fe);
725 }
726
727 if (!fe.isDirectory()) {
728 dir = "./";
729 fe = new File(dir).getAbsoluteFile();
730
731 if (!fe.isDirectory()) {
732 return;
733 }
734 }
735 try {
736 dir = this.dir = fe.getCanonicalPath();
737 } catch (java.io.IOException ie) {
738 dir = this.dir = fe.getAbsolutePath();
739 }
740 pathField.setText(this.dir);
741
742
743 if (dir.endsWith("/")) {
|
703 * We cann't update savedDir here now since it used very often
704 */
705 public void setDirectory(String dir) {
706
707 if (dir == null) {
708 this.dir = null;
709 return;
710 }
711
712 if (dir.equals(this.dir)) {
713 return;
714 }
715
716 int i;
717 if ((i=dir.indexOf("~")) != -1) {
718
719 dir = dir.substring(0,i) + System.getProperty("user.home") + dir.substring(i+1,dir.length());
720 }
721
722 File fe = new File(dir).getAbsoluteFile();
723 if (log.isLoggable(PlatformLogger.Level.FINE)) {
724 log.fine("Current directory : " + fe);
725 }
726
727 if (!fe.isDirectory()) {
728 dir = "./";
729 fe = new File(dir).getAbsoluteFile();
730
731 if (!fe.isDirectory()) {
732 return;
733 }
734 }
735 try {
736 dir = this.dir = fe.getCanonicalPath();
737 } catch (java.io.IOException ie) {
738 dir = this.dir = fe.getAbsolutePath();
739 }
740 pathField.setText(this.dir);
741
742
743 if (dir.endsWith("/")) {
|