653654655656657658659660661662663
public void close() { if (!connection.isClosed()) { try { super.close(); } catch (IOException e) { throw new FaultException("System error closing stream", e); } finally { connection.close(); } } }
919293949596979899100101
return mapper.getMethodDefs(new InputSource(contentStream)); } finally { try { contentStream.close(); } catch (IOException e) { throw new FaultException(e); } } } else { return new MethodDef[0]; }
147148149150151152153154
*/ public static InputStream getStream(String string) { try { return new ByteArrayInputStream(string.getBytes("UTF-8")); } catch (UnsupportedEncodingException wontHappen) { throw new FaultException(wontHappen); } }
495051525354555657
return null; } finally { try { in.close(); } catch (IOException e) { throw new FaultException(e); } } }
117118119120121122123124
private static String getString(byte[] bytes) { try { if (bytes == null) return null; return new String(bytes, "UTF-8"); } catch (UnsupportedEncodingException wontHappen) { throw new FaultException(wontHappen); } }
126127128129130131132133
private static byte[] getBytes(String string) { try { if (string == null) return null; return string.getBytes("UTF-8"); } catch (UnsupportedEncodingException wontHappen) { throw new FaultException(wontHappen); } }
140141142143144145146147
try { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); m_parser = spf.newSAXParser(); } catch (Exception wontHappen) { throw new FaultException(wontHappen); } }
155315541555155615571558155915601561
"server/config/fedora.fcfg")); ServerConfigurationParser parser = new ServerConfigurationParser(fcfg); return parser.parse(); } catch (IOException e) { throw new FaultException("Error loading server configuration", e); } }
264265266267268269270271
} repo.putObject(obj); DOReader reader = repo.getReader(false, ReadOnlyContext.EMPTY, TEST_PID); return reader; } catch (Exception wontHappen) { throw new FaultException(wontHappen); } }
321322323324325326327328
private static InputStream toStream(String string) { try { return new ByteArrayInputStream(string.getBytes("UTF-8")); } catch (IOException wontHappen) { throw new FaultException(wontHappen); } }