List of usage examples for java.io InvalidObjectException toString
public String toString()
From source file:org.sakaiproject.content.chh.file.ContentHostingHandlerImplFileSystem.java
private synchronized void removeProperties(ContentEntityFileSystem cefs) { String propFileName = getPropertiesFileName(cefs); BufferedReader r = null;/*from w ww . ja v a2 s. c o m*/ Writer w = null; // Algorithm: copy properties from old file for everything except this filename; // rename new properties file on top of old one. String fileIdPrefix = cefs.basePath + propertiesFileFieldSeparator + cefs.relativePath + propertiesFileFieldSeparator; try { w = new BufferedWriter(new FileWriter(propFileName + ".new")); try { r = new BufferedReader(new FileReader(propFileName)); String line = null; while ((line = r.readLine()) != null) if (!line.startsWith(fileIdPrefix)) w.write(line + "\n"); r.close(); } catch (InvalidObjectException e) { /* file doesn't exist / unreadable -- ignore */} catch (FileNotFoundException e) { /* file doesn't exist / unreadable -- ignore */} // move new file over old one w.flush(); w.close(); new File(propFileName).delete(); new File(propFileName + ".new").renameTo(new File(propFileName)); } catch (IOException e) { log.warn("Content Hosting Handler File System was unable to remove Sakai properties: " + e.toString()); } finally { if (w != null) try { w.flush(); w.close(); } catch (Exception e) { } if (r != null) try { r.close(); } catch (Exception e) { } r = null; w = null; } }