Package webapp

Examples of webapp.WebAppException


    public void doSave(File file, Resume resume) {
        try {
            file.createNewFile();
        } catch (IOException e) {
            throw new WebAppException("Couldn't write file " + file.getAbsolutePath(), resume, e);
        }
        write(file, resume);
    }
View Full Code Here


    protected void write(File file, Resume resume) {
        try {
            doWrite(new FileOutputStream(file), resume);
        } catch (IOException e) {
            throw new WebAppException("Couldn't write file " + file.getAbsolutePath(), resume, e);
        }
    }
View Full Code Here

        try {
            Resume r = doRead(new FileInputStream(file));
            r.setUuid(file.getName());
            return r;
        } catch (IOException e) {
            throw new WebAppException("Couldn't read file " + file.getAbsolutePath(), e);
        }
    }
View Full Code Here

        if (!exist(ctx)) {
            LOGGER.info("Save resume with uuid=" + resume.getUuid());
            doSave(ctx, resume);
            return resume.getUuid();
        }
        throw new WebAppException("Resume " + resume + " already present", resume);
    }
View Full Code Here

        LOGGER.info("Load resume with uuid=" + uuid);
        C ctx = createCtx(uuid);
        if (exist(ctx)) {
            return doLoad(ctx);
        }
        throw new WebAppException("Resume not found", uuid);
    }
View Full Code Here

        C ctx = createCtx(uuid);
        if (exist(ctx)) {
            doDelete(ctx);
            return;
        }
        throw new WebAppException("Resume not found", uuid);
    }
View Full Code Here

        C ctx = createCtx(resume.getUuid());
        if (exist(ctx)) {
            doUpdate(ctx, resume);
            return;
        }
        throw new WebAppException("Resume not found", resume);
    }
View Full Code Here

    @Override
    protected Resume doRead(InputStream is) throws IOException {
        try (ObjectInputStream ois = new ObjectInputStream(is)) {
            return (Resume) ois.readObject();
        } catch (ClassNotFoundException e) {
            throw new WebAppException("Error read resume", e);
        }
    }
View Full Code Here

TOP

Related Classes of webapp.WebAppException

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.