Package org.fcrepo.common

Examples of org.fcrepo.common.FaultException


        public void close() {
            if (!connection.isClosed()) {
                try {
                    super.close();
                } catch (IOException e) {
                    throw new FaultException("System error closing stream", e);
                } finally {
                    connection.close();
                }
            }
        }
View Full Code Here


                return mapper.getMethodDefs(new InputSource(contentStream));
            } finally {
                try {
                    contentStream.close();
                } catch (IOException e) {
                    throw new FaultException(e);
                }
            }
        } else {
            return new MethodDef[0];
        }
View Full Code Here

     */
    public static InputStream getStream(String string) {
        try {
            return new ByteArrayInputStream(string.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException wontHappen) {
            throw new FaultException(wontHappen);
        }
    }
View Full Code Here

            return null;
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                throw new FaultException(e);
            }
        }
    }
View Full Code Here

    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);
        }
    }
View Full Code Here

    private static byte[] getBytes(String string) {
        try {
            if (string == null) return null;
            return string.getBytes("UTF-8");
        } catch (UnsupportedEncodingException wontHappen) {
            throw new FaultException(wontHappen);
        }
    }
View Full Code Here

        try {
            SAXParserFactory spf = SAXParserFactory.newInstance();
            spf.setNamespaceAware(true);
            m_parser = spf.newSAXParser();
        } catch (Exception wontHappen) {
            throw new FaultException(wontHappen);
        }
    }
View Full Code Here

                             "server/config/fedora.fcfg"));
            ServerConfigurationParser parser =
                new ServerConfigurationParser(fcfg);
            return parser.parse();
        } catch (IOException e) {
            throw new FaultException("Error loading server configuration",
                                     e);
        }
    }
View Full Code Here

            }
            repo.putObject(obj);
            DOReader reader = repo.getReader(false, ReadOnlyContext.EMPTY, TEST_PID);
            return reader;
        } catch (Exception wontHappen) {
            throw new FaultException(wontHappen);
        }
    }
View Full Code Here

    private static InputStream toStream(String string) {
        try {
            return new ByteArrayInputStream(string.getBytes("UTF-8"));
        } catch (IOException wontHappen) {
            throw new FaultException(wontHappen);
        }
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.common.FaultException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.