Examples of BeeResource


Examples of org.sf.bee.commons.localstore.BeeResource

        }
        return __tempResource;
    }

    private File getTempFile() {
        final BeeResource resource = this.getTempResource();
        final File temp = new File(resource.getUrl());
        try {
            if (!resource.exists()) {
                this.download(temp);
            }
        } catch (Throwable t) {
            this.getLogger().log(Level.SEVERE,
                    StringUtils.format("Error calling 'getTempFile' on FTP client: {0}",
View Full Code Here

Examples of org.sf.bee.commons.localstore.BeeResource

    }

    private void writeFile(final Logger sender) {
        if (_fileEnabled) {
            final String fileName = this.getLogFileName(sender.getName());
            final BeeResource resource = BeeLocalStore.getInstance().getResource(
                    fileName, true);
            try {
                resource.setText(this.toString(sender));
            } catch (IOException ex) {
                System.out.println(ex);
            }
        }
    }
View Full Code Here

Examples of org.sf.bee.commons.localstore.BeeResource

    public BeeResource encodeFile(final String sourceFileName,
            final String targetFileName,
            final String secret) {
        try {
            final BeeResource res = new BeeResource(sourceFileName);
            if (res.exists()) {
                final InputStream is = res.openInputStream();
                try {
                    return this.encodeResource(
                            targetFileName,
                            is,
                            secret);
View Full Code Here

Examples of org.sf.bee.commons.localstore.BeeResource

    public BeeResource decodeFile(final String sourceFileName,
            final String targetFileName,
            final String secret) {
        try {
            final BeeResource source = new BeeResource(sourceFileName);
            if (source.exists()) {
                final InputStream is = source.openInputStream();
                return this.decodeResource(
                        targetFileName,
                        is,
                        secret);
            }
View Full Code Here

Examples of org.sf.bee.commons.localstore.BeeResource

    // ------------------------------------------------------------------------

    private BeeResource encodeResource(final String targetFileName,
            final InputStream is, final String secret) {
        try {
            final BeeResource result;
            if (StringUtils.hasText(targetFileName)) {
                result = new BeeResource(targetFileName);
                result.mkdirs();
            } else {
                result = BeeLocalStore.getInstance().getTempResource();
            }
            final OutputStream os = result.openOutputStream();
            try {
                int total = 0;
                // write bytes
                byte[] data;
                while ((data = BeeResource.getNext(is, ENCODEBUFFER)).length > 0) {
View Full Code Here

Examples of org.sf.bee.commons.localstore.BeeResource

    }

    private BeeResource decodeResource(final String targetFileName,
            final InputStream is, final String secret) {
        try {
            final BeeResource result;
            if (StringUtils.hasText(targetFileName)) {
                result = new BeeResource(targetFileName);
                result.mkdirs();
            } else {
                result = BeeLocalStore.getInstance().getTempResource();
            }
            final OutputStream os = result.openOutputStream();
            try {
                int total = 0;
                // write bytes
                int buffer = StringUtils.hasText(secret)
                        ? DECODEBUFFER_CRYPTO
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.