Changeset 8 for trunk/src/org/expeditee/gui/FrameIO.java
- Timestamp:
- 05/01/08 15:12:45 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameIO.java
r7 r8 11 11 import java.util.HashMap; 12 12 13 import org.expeditee.agents.ExistingFramesetException; 13 14 import org.expeditee.io.Conversion; 14 15 import org.expeditee.io.ExpReader; … … 418 419 int lastNumber = FrameIO.getLastNumber(DELETED_FRAMES); 419 420 String framePath; 420 try {421 try { 421 422 // create the new frameset 422 423 Frame one = FrameIO.CreateFrameset(DELETED_FRAMES, toDelete.path); 423 424 framePath = one.path; 424 425 lastNumber = 0; 425 } catch (Exception e){426 } catch (Exception e) { 426 427 Frame zero = FrameIO.LoadFrame(DELETED_FRAMES + "0"); 427 428 framePath = zero.path; … … 565 566 * @return The first Frame of the new Frameset (Frame.1) 566 567 */ 567 public static Frame CreateFrameset(String frameset, String path) throws Exception{ 568 public static Frame CreateFrameset(String frameset, String path) 569 throws Exception { 568 570 return CreateFrameset(frameset, path, false); 569 571 } … … 585 587 586 588 // String must begin with a letter and end with a digit 587 if (!(Character.isLetter(frameName.charAt(0)) || Character.isDigit(frameName.charAt(0))) 589 if (!(Character.isLetter(frameName.charAt(0)) || Character 590 .isDigit(frameName.charAt(0))) 588 591 || !Character.isDigit(frameName.charAt(frameName.length() - 1))) 589 592 return false; … … 713 716 } 714 717 715 public static Frame CreateNewProfile(String username) throws Exception {718 public static Frame CreateNewProfile(String username) throws Exception { 716 719 Frame profile = CreateFrameset(username, PROFILE_PATH); 717 720 FrameUtils.CreateDefaultProfile(profile); … … 771 774 } 772 775 773 private static String NameValidation(String toValidate) throws Exception {776 private static String NameValidation(String toValidate) throws Exception { 774 777 String result = ""; 775 778 … … 780 783 // check for illegal characters 781 784 if (ILLEGAL_CHARS.contains("" + cur)) { 782 throw new Exception("Frameset name contains illegal character '" 783 + cur + "' at position " + (i + 1)); 785 throw new Exception( 786 "Frameset name contains illegal character '" + cur 787 + "' at position " + (i + 1)); 784 788 } 785 789 … … 796 800 if (result.length() >= MAX_NAME_LENGTH) { 797 801 throw new Exception("Frameset name is too long (Max " 798 802 + MAX_NAME_LENGTH + " characters)"); 799 803 } 800 804 } … … 835 839 * frame) 836 840 */ 837 public static Frame CreateNewFrameset(String name) throws Exception {841 public static Frame CreateNewFrameset(String name) throws Exception { 838 842 String path = DisplayIO.getCurrentFrame().path; 839 843 … … 887 891 888 892 public static Frame CreateFrameset(String frameset, String path, 889 boolean recreate) throws Exception {893 boolean recreate) throws Exception { 890 894 String conversion = frameset + " --> "; 891 895 … … 897 901 898 902 if (!recreate && FrameIO.DoesFramesetExist(frameset)) { 899 throw new Ex ception("A frameset called " + frameset + " already exists.");903 throw new ExistingFramesetException(frameset); 900 904 } 901 905
Note:
See TracChangeset
for help on using the changeset viewer.