Package org.fakereplace.client

Examples of org.fakereplace.client.ResourceData


    private void handleArtifact(final ZipFile zipFile, final Map<String, ResourceData> resources) {
        Enumeration<? extends ZipEntry> entries = zipFile.entries();
        while (entries.hasMoreElements()) {
            final ZipEntry entry = entries.nextElement();
            if (!entry.isDirectory()) {
                resources.put(entry.getName(), new ResourceData(entry.getName(), entry.getTime(), new ContentSource() {
                    @Override
                    public byte[] getData() throws IOException {
                        final InputStream stream = zipFile.getInputStream(entry);
                        try {
                            return Util.getBytesFromStream(stream);
View Full Code Here


    public void queueClassForReplacement(Class<?> oldClass, Class<?> newClass) {
        queuedClassReplacements.put(oldClass, newClass);
    }

    public void queueResourceForReplacement(final Class<?> packageClass, final String old, final String newResource) {
        replacedResources.put(old, new ResourceData(old, new Date().getTime(), new ContentSource() {
            @Override
            public byte[] getData() throws IOException {
                final InputStream stream = packageClass.getResource(newResource).openStream();
                try {
                    ByteArrayOutputStream bs = new ByteArrayOutputStream();
View Full Code Here

TOP

Related Classes of org.fakereplace.client.ResourceData

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.