Package com.sun.syndication.propono.atom.server

Examples of com.sun.syndication.propono.atom.server.AtomException


                    MediaFileDirectory mdir =
                        fileMgr.getMediaFileDirectoryByPath(website, justPath);

                    if (mdir.hasMediaFile(fileName)) {
                        throw new AtomException("Duplicate file name");
                    }

                    if (path.length() > 0) path = path + File.separator;
                    FileInputStream fis = new FileInputStream(tempFile);

                    MediaFile mf = new MediaFile();
                    mf.setDirectory(mdir);
                    mf.setWeblog(website);
                    mf.setName(fileName);
                    mf.setOriginalPath(justPath);
                    mf.setContentType(contentType);
                    mf.setInputStream(fis);
                    mf.setLength(tempFile.length());

                    RollerMessages errors = new RollerMessages();
                    fileMgr.createMediaFile(website, mf, errors);
                    if (errors.getErrorCount() > 0) {
                        throw new AtomException(errors.toString());
                    }

                    roller.flush();
                   
                    fis.close();
                                     
                    MediaFile stored = fileMgr.getMediaFile(mf.getId());
                    Entry mediaEntry = createAtomResourceEntry(website, stored);
                    for (Iterator it = mediaEntry.getOtherLinks().iterator(); it.hasNext();) {
                        Link link = (Link)it.next();
                        if ("edit".equals(link.getRel())) {
                            log.debug("Exiting");
                            return mediaEntry;
                        }
                    }
                    log.error("ERROR: no edit link found in saved media entry");
                   
                } catch (FileIOException fie) {
                    throw new AtomException(
                        "File upload disabled, over-quota or other error", fie);
                } finally {
                    if (tempFile != null) tempFile.delete();
                }
            }
            throw new AtomException("Error saving media entry");
       
        } catch (WebloggerException re) {
            throw new AtomException("Posting media", re);
        } catch (IOException ioe) {
            throw new AtomException("Posting media", ioe);
        }
    }
View Full Code Here


            if (mf != null) {
                return createAtomResourceEntry(website, mf);
            }
           
        } catch (WebloggerException ex) {
            throw new AtomException("ERROR fetching entry",ex);
        }
        throw new AtomNotFoundException("ERROR resource not found");
    }
View Full Code Here

                            mf.getName(),
                            mf.getLength(),
                            new Date(mf.getLastModified()),
                            mf.getInputStream());
                } catch (Exception e) {
                    throw new AtomException(
                        "Unexpected error during file upload", e);
                }
            }
            throw new AtomException("Incorrect path information");
       
        } catch (WebloggerException re) {
            throw new AtomException("Posting media");
        }
    }
View Full Code Here

            log.debug("Exiting");
            return feed;
      
        } catch (WebloggerException re) {
            throw new AtomException("Getting resource collection", re);
        }
    }
View Full Code Here

                   
                    log.debug("Exiting");
                    return;

                } catch (FileIOException fie) {
                    throw new AtomException(
                        "File upload disabled, over-quota or other error", fie);
                } catch (Exception e) {
                    throw new AtomException(
                        "Unexpected error during file upload", e);
                } finally {
                    if (tempFile != null) tempFile.delete();
                }
            }
            throw new AtomException("Incorrect path information");
       
        } catch (WebloggerException re) {
            throw new AtomException("Posting media");
        } catch (IOException ioe) {
            throw new AtomException("Posting media", ioe);
        }
    }
View Full Code Here

                    return;
                   
                } catch (Exception e) {
                    String msg = "ERROR deleting media entry";
                    log.error(msg, e);
                    throw new AtomException(msg);
                }
            }
            log.debug("Not authorized to delete media entry");
            log.debug("Exiting via exception");

        } catch (WebloggerException ex) {
            throw new AtomException("ERROR deleting media entry",ex);
        }
        throw new AtomNotAuthorizedException("Not authorized to delete entry");
    }
View Full Code Here

            }
            log.error("ERROR: no edit link found in saved media entry");
            log.debug("Exiting via exception");

        } catch (WebloggerException re) {
            throw new AtomException("Posting entry", re);
        }
        throw new AtomException("Posting entry");
    }
View Full Code Here

                throw new AtomNotAuthorizedException("Not authorized to view entry");
            } else {
                return createAtomEntry(entry);
            }
        } catch (WebloggerException ex) {
            throw new AtomException("ERROR fetching entry", ex);
        }
    }
View Full Code Here

           
            log.debug("Exiting");
            return feed;
       
        } catch (WebloggerException re) {
            throw new AtomException("Getting entry collection");
        }
    }
View Full Code Here

                throw new AtomNotAuthorizedException("ERROR not authorized to update entry");
            }
            throw new AtomNotFoundException("Cannot find specified entry/resource");
           
        } catch (WebloggerException re) {
            throw new AtomException("Updating entry");
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.syndication.propono.atom.server.AtomException

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.