Package org.gradle.internal.resource

Examples of org.gradle.internal.resource.ResourceException


                    resource.writeTo(destination);
                } finally {
                    resource.close();
                }
            } catch (IOException e) {
                throw new ResourceException(String.format("Failed to download resource '%s'.", resource.getName()), e);
            }
            return cacheLockingManager.useCache(String.format("Store %s", resource.getName()), new Factory<LocallyAvailableExternalResource>() {
                public LocallyAvailableExternalResource create() {
                    LocallyAvailableResource cachedResource = fileStore.moveIntoCache(destination);
                    File fileInFileStore = cachedResource.getFile();
View Full Code Here


                    String contentType = resource.getContentType();
                    ApacheDirectoryListingParser directoryListingParser = new ApacheDirectoryListingParser();
                    try {
                        return directoryListingParser.parse(parent, inputStream, contentType);
                    } catch (Exception e) {
                        throw new ResourceException("Unable to parse HTTP directory listing.", e);
                    }
                }
            });
        } finally {
            resource.close();
View Full Code Here

    private static final Logger LOGGER = LoggerFactory.getLogger(ApacheDirectoryListingParser.class);

    public List<String> parse(URI baseURI, InputStream content, String contentType) throws Exception {
        baseURI = addTrailingSlashes(baseURI);
        if (contentType == null || !contentType.startsWith("text/html")) {
            throw new ResourceException(String.format("Unsupported ContentType %s for DirectoryListing", contentType));
        }
        String contentEncoding = UriResource.extractCharacterEncoding(contentType, "utf-8");
        final Reader htmlText = new InputStreamReader(content, contentEncoding);
        final InputSource inputSource = new InputSource(htmlText);
        final SAXParser htmlParser = new SAXParser();
View Full Code Here

                        // Try next
                        if (failure == null) {
                            failure = e;
                        }
                    } catch (Exception e) {
                        throw new ResourceException(String.format("Failed to list versions for %s.", module), e);
                    }
                }
                throw failure;
            }
        };
View Full Code Here

        try {
            parseMavenMetadataInfo(metadataLocation, metadata);
        } catch (ResourceNotFoundException e) {
            throw e;
        } catch (Exception e) {
            throw new ResourceException(String.format("Unable to load Maven meta-data from %s.", metadataLocation), e);
        }
        return metadata;
    }
View Full Code Here

                        dest.add(versionString);
                    }
                } catch (ResourceException e) {
                    throw e;
                } catch (Exception e) {
                    throw new ResourceException(String.format("Could not list versions using %s.", pattern), e);
                }
            }

            // lists all the values a revision token listed by a given url lister
            private List<String> listRevisionToken(ExternalResourceName versionListPattern) throws IOException {
View Full Code Here

            try {
                if (repository.getResourceMetaData(location.getUri()) != null) {
                    return true;
                }
            } catch (IOException e) {
                throw new ResourceException(String.format("Could not get resource '%s'.", location), e);
            }
        }
        return false;
    }
View Full Code Here

                }, localCandidates);
                if (resource != null) {
                    return resource;
                }
            } catch (IOException e) {
                throw new ResourceException(String.format("Could not get resource '%s'.", location), e);
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.gradle.internal.resource.ResourceException

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.