Changeset 14817
- Timestamp:
- 2007-11-19T11:22:33+13:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java
r14358 r14817 380 380 if (!new File(collection_directory_path).exists()) { 381 381 // If there is no collection directory then the creation was unsuccessful, or cancelled 382 382 383 383 return; 384 384 } … … 959 959 System.err.println("Cannot write lock file!"); 960 960 String args[] = new String[2]; 961 args[0] = location; 962 args[1] = Dictionary.get("FileActions.Write_Not_Permitted_Title"); 961 args[0] = location; 962 args[1] = Dictionary.get("FileActions.Write_Not_Permitted_Message", new String[]{lock_file.getAbsolutePath()}); 963 if(Gatherer.client_operating_system.toUpperCase().indexOf("WINDOWS")!=-1){ 964 //if(Gatherer.client_operating_system.toUpperCase().indexOf("VISTA")!=-1){ 965 args[1] += Dictionary.get("FileActions.File_Permission_Detail", new String[]{Configuration.gsdl_path, System.getProperty("user.name")}); 966 //} 967 } 963 968 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Open_With_Reason", args), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 964 969 args = null; … … 1019 1024 // There is obviously no existing collection present. 1020 1025 DebugStream.printStackTrace(error); 1026 error.printStackTrace(); 1021 1027 if(error.getMessage() != null) { 1022 1028 String[] args = new String[2]; 1023 args[0] = location; 1024 args[1] = error.getMessage(); 1029 args[0] = location; 1030 //args[1] = error.getMessage(); 1031 args[1] = "The Librarian Interface does not have permission to write to... Please check file permissions."; 1025 1032 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Open_With_Reason", args), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 1026 1033 } … … 1072 1079 */ 1073 1080 public synchronized void message(GShellEvent event) { 1081 1074 1082 } 1075 1083 … … 1159 1167 Gatherer.g_man.repaint(); 1160 1168 } 1161 else if (event.getStatus() == GShell.ERROR) { 1162 DebugStream.println("There was an error in the gshell:"+ event.getMessage()); 1163 if (event.getType() == GShell.NEW) { 1164 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Create_Collection"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 1165 } else { 1169 else if (event.getStatus() == GShell.ERROR) { 1170 if (event.getType() == GShell.NEW) { 1171 String name = event.getMessage(); 1172 String collectDir = getCollectionDirectoryPath(name); 1173 String errMsg = ""; 1174 if (!new File(getCollectionDirectoryPath(name)).exists() || !new File(getCollectionDirectoryPath(name)).canWrite()) { 1175 String reason = Dictionary.get("FileActions.Write_Not_Permitted_Message", new String[]{collectDir}); 1176 errMsg = Dictionary.get("CollectionManager.Cannot_Create_Collection_With_Reason", new String[]{reason}); 1177 if(Gatherer.client_operating_system.toUpperCase().indexOf("WINDOWS") != -1){ 1178 //if(Gatherer.client_operating_system.toUpperCase().indexOf("VISTA")!=-1){ 1179 errMsg += Dictionary.get("FileActions.File_Permission_Detail", new String[]{Configuration.gsdl_path, System.getProperty("user.name")}); 1180 //} 1181 } 1182 } else { 1183 errMsg = Dictionary.get("CollectionManager.Cannot_Create_Collection"); 1184 } 1185 JOptionPane.showMessageDialog(Gatherer.g_man, errMsg, Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 1186 } 1187 else { 1166 1188 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Preview_Ready_Failed"), Dictionary.get("CollectionManager.Preview_Ready_Title"), JOptionPane.ERROR_MESSAGE); 1167 1189 Gatherer.refresh(Gatherer.COLLECTION_REBUILT);
Note:
See TracChangeset
for help on using the changeset viewer.