@Override public int compare(File o1, File o2) { try { String path1 = o1.getCanonicalPath(); String path2 = o2.getCanonicalPath(); return path2.compareTo(path1); } catch(IOException e) { throw new WrappedException(e); } } };
@Override public String toString() { try { log.write("result["); log.write(Long.toString(id)); log.write("].toString();\n"); log.flush(); } catch(IOException e) { throw new WrappedException(e); } return wrapped.toString(); }
@Override public String next() { try { if(next==null) throw new NoSuchElementException(); String retVal = next.getPath(); next = filesystemIterator.getNextFile(); return retVal; } catch(IOException err) { throw new WrappedException(err); } }
@Override public void afterRelease() { try { sortIfNeeded(list); } catch(IOException | SQLException err) { throw new WrappedException(err); } } }
@Override final public String toString() { try { return getTableSchema().display; } catch(IOException | SQLException err) { throw new WrappedException(err); } }
@Override public int hashCode() { try { return FileUtils.contentHashCode(file); } catch(IOException e) { throw new WrappedException(e); } }
@Override default Object[] toArray() { try { return getRows().toArray(); } catch(SQLException err) { throw new WrappedException(err); } }
@Override public void clear() { try { frf.removeAllRecords(); modCount++; } catch(IOException err) { throw new WrappedException(err, new Object[] {"frf="+frf}); } }
@Override final public Object getColumn(int i) { try { return getColumnImpl(i); } catch(IOException | SQLException err) { throw new WrappedException(err); } }
@Override public boolean equals(Object o) { if(this == o) return true; if(!(o instanceof FileMessage)) return false; FileMessage other = (FileMessage)o; try { return FileUtils.contentEquals(file, other.file); } catch(IOException e) { throw new WrappedException(e); } }
/** * Gets a string representation of this object in the current thread locale. * * @see #toString(java.util.Locale) */ @Override final public String toString() { try { return toStringImpl(); } catch(IOException | SQLException err) { throw new WrappedException(err); } }
@Override public String toString() { try { log.write("writer["); log.write(Long.toString(id)); log.write("].toString();\n"); log.flush(); } catch(IOException e) { throw new WrappedException(e); } return "LoggingWriter(" + wrapped.toString() + ")"; }
public void swap(int index1, int index2) { try { frf.swap(index1, index2); } catch(IOException err) { throw new WrappedException(err, new Object[] {"frf="+frf}); } }
@Override public int size() { try { return frf.getRecordCount(); } catch(IOException err) { throw new WrappedException(err, new Object[] {"frf="+frf}); } }
@Override default <T> T[] toArray(T[] a) { try { return getRows().toArray(a); } catch(SQLException err) { throw new WrappedException(err); } }
@Override public Iterator<V> iterator() { try { return getRows().iterator(); } catch(IOException | SQLException err) { throw new WrappedException(err); } }
@Override default int size() { try { return getSize(); } catch(SQLException err) { throw new WrappedException(err); } }
@Override public void remove() { try { if(expectedModCount!=modCount) throw new ConcurrentModificationException(); if(lastId==-1) throw new IllegalStateException(); deallocate(lastId); expectedModCount++; lastId = -1; } catch(IOException err) { throw new WrappedException(err); } } };
@Override // @NotThreadSafe public Object[] toArray() { try { if(_size>Integer.MAX_VALUE) throw new RuntimeException("Too many elements in list to create Object[]: "+_size); Object[] result = new Object[(int)_size]; int i = 0; for (long ptr = getHead(); ptr != END_PTR; ptr = getNext(ptr)) result[i++] = getElement(ptr); return result; } catch(IOException err) { throw new WrappedException(err); } }
private AOServer getAOServer(String hostname) throws IllegalArgumentException, IOException, SQLException { try { AOServer ao=DomainName.validate(hostname).isValid() ? connector.getAoServers().get(DomainName.valueOf(hostname)) : null; if(ao==null) throw new IllegalArgumentException("Server is not an AOServer: "+hostname); return ao; } catch(ValidationException e) { // Should not happen since isValid checked first throw new WrappedException(e); } }