Refine search
throw new TransferFailedException( "Unsupported Protocol: '" + protocol + "': " + e.getMessage(), e ); logger.debug( "SHA1 not found, trying MD5: " + sha1TryException.getMessage() ); throw new TransferFailedException( "Connection failed: " + e.getMessage(), e ); throw new TransferFailedException( "Authentication failed: " + e.getMessage(), e ); throw new ResourceDoesNotExistException( "Downloaded file does not exist: " + temp );
public void getMd5Hash(Repository repository, NugetArtifact artifact, File destination) throws TransferFailedException, ResourceDoesNotExistException { if (!artifact.isNugetFile()) { throw new ResourceDoesNotExistException("hash for files extracted from nuget archive not supported."); } try (CloseableHttpClient client = HttpClients.createDefault()) { HttpHead headRequest = new HttpHead(repository.getUrl() + "/" + artifact.resourceString()); try (CloseableHttpResponse response = client.execute(headRequest)) { Header checkSum = response.getFirstHeader("Content-MD5"); if (checkSum == null) { throw new ResourceDoesNotExistException("Content-MD5 header not set"); } FileUtils.write(destination, checkSum.getValue(), StandardCharsets.ISO_8859_1); } } catch (IOException e) { throw new TransferFailedException(e.getMessage(), e); } } }
private void provideUnpackedFile(File destination, File file) throws TransferFailedException, IOException, ResourceDoesNotExistException { if (file.exists()) { if (destination.exists() && !destination.delete()) { throw new TransferFailedException("cannot delete file " + destination.getAbsolutePath()); } Files.createLink(destination.toPath(), file.toPath()); } else { throw new ResourceDoesNotExistException("no compatible artifact found in nuget package"); } }
public List<String> getFileList( String destinationDirectory ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { if ( getRepository().getBasedir() == null ) { throw new TransferFailedException( "Unable to getFileList() with a null basedir." ); } File path = resolveDestinationPath( destinationDirectory ); if ( !path.exists() ) { throw new ResourceDoesNotExistException( "Directory does not exist: " + destinationDirectory ); } if ( !path.isDirectory() ) { throw new ResourceDoesNotExistException( "Path is not a directory: " + destinationDirectory ); } File[] files = path.listFiles(); List<String> list = new ArrayList<String>( files.length ); for ( File file : files ) { String name = file.getName(); if ( file.isDirectory() && !name.endsWith( "/" ) ) { name += "/"; } list.add( name ); } return list; }
HttpHost targetHost = new HttpHost( repo.getHost(), repo.getPort(), repo.getProtocol() ); AuthScope targetScope = getBasicAuthScope().getScope( targetHost ); throw new ResourceDoesNotExistException( "File " + url + " does not exist" ); TransferFailedException e = new TransferFailedException( "Failed to transfer file " + url + " with status code " + statusCode ); fireTransferError( resource, e, TransferEvent.REQUEST_PUT ); throw new TransferFailedException( e.getMessage(), e ); throw new TransferFailedException( e.getMessage(), e );
public void run( Wagon wagon ) throws Exception { String src = task.getLocation().toString(); if ( !wagon.resourceExists( src ) ) { throw new ResourceDoesNotExistException( "Could not find " + src + " in " + wagon.getRepository().getUrl() ); } }
Repository repo = new Repository( sourceUrl.getHost(), baseUrl ); messageHolder.addMessage( "Connecting to: " + repo.getHost() + "(baseUrl: " + repo.getUrl() + ")" ); throw new DownloadFailedException( url, "Download failed. Reason: " + e.getMessage(), e ); throw new DownloadFailedException( url, "Download failed. Reason: " + e.getMessage(), e );
private void ftpChangeDirectory( Resource resource ) throws IOException, TransferFailedException, ResourceDoesNotExistException { if ( !ftp.changeWorkingDirectory( getRepository().getBasedir() ) ) { throw new ResourceDoesNotExistException( "Required directory: '" + getRepository().getBasedir() + "' " + "is missing" ); } String[] dirs = PathUtils.dirnames( resource.getName() ); for ( String dir : dirs ) { boolean dirChanged = ftp.changeWorkingDirectory( dir ); if ( !dirChanged ) { String msg = "Resource " + resource + " not found. Directory " + dir + " does not exist"; throw new ResourceDoesNotExistException( msg ); } } }
String basedir = repository.getBasedir(); dir = StringUtils.replace( dir, "\\", "/" ); String dest = repository.getUrl(); Resource resource = new Resource( resourceName ); throw new TransferFailedException( "Destination path exists and is not a WebDAV collection (directory): " + cdpath ); throw new TransferFailedException( "Failed to create destination WebDAV collection (directory): " + relpath, ioe ); throw new TransferFailedException( "Failed to create destination WebDAV collection (directory): " + relpath, e ); throw new ResourceDoesNotExistException( "File: " + dest + " does not exist" ); throw new ResourceDoesNotExistException( "Transfer failed, server requires Content-Length." );
throw new TransferFailedException( "Unsupported Protocol: '" + protocol + "': " + e.getMessage(), e ); wagon.connect( new Repository( repository.getId(), repository.getUrl() ), getAuthenticationInfo( repository.getId() ), new ProxyInfoProvider() throw new TransferFailedException( "Unable to add checksum methods: " + e.getMessage(), e ); throw new TransferFailedException( "Connection failed: " + e.getMessage(), e ); throw new ResourceDoesNotExistException( "Downloaded file does not exist: " + temp );
@Override protected boolean isRemoteResourceNewer(String resourceName, long timestamp) throws ResourceDoesNotExistException { try { Date lastModified = getObjectMetadata(resourceName).getLastModified(); return lastModified == null ? true : lastModified.getTime() > timestamp; } catch (AmazonServiceException e) { throw new ResourceDoesNotExistException(String.format("'%s' does not exist", resourceName), e); } }
throw new TransferFailedException( "Unsupported Protocol: '" + protocol + "': " + e.getMessage(), e ); throw new TransferFailedException( "Unable to add checksum methods: " + e.getMessage(), e ); Repository artifactRepository = new Repository( repository.getId(), repository.getUrl() ); "adding permissions to wagon connection: " + perms.getFileMode() + " " + perms.getDirectoryMode() ); artifactRepository.setPermissions( perms ); artifactRepository.setPermissions( defaultRepositoryPermissions ); throw new TransferFailedException( "Connection failed: " + e.getMessage(), e ); throw new TransferFailedException( "Resource to deploy not found: " + e.getMessage(), e );
repository.getPort() == WagonConstants.UNKNOWN_PORT ? ScpHelper.DEFAULT_SSH_PORT : repository.getPort(); if ( port != ScpHelper.DEFAULT_SSH_PORT ) String remoteFile = getRepository().getBasedir() + "/" + resourceName; && err.getOutput().trim().toLowerCase( Locale.ENGLISH ).contains( "no such file or directory" ) ) throw new ResourceDoesNotExistException( err.getOutput() ); new TransferFailedException( "Exit code: " + exitCode + " - " + err.getOutput() ); throw new TransferFailedException( "Error executing command line", e );
throw new ResourceDoesNotExistException( "Specified source file does not exist: " + source ); String basedir = getRepository().getBasedir(); if ( getRepository().getPermissions() != null ) String dirPerms = getRepository().getPermissions().getDirectoryMode(); throw new TransferFailedException( "Error executing command for transfer", e ); throw new TransferFailedException( "Error executing command for transfer", e );
String error = ( e.getMessage() != null ) ? e.getMessage() : e.getClass().getSimpleName(); updateCheckManager.touch( artifact, repository, error ); throw e; if ( error != null ) throw new TransferFailedException( "Failure to resolve " + remotePath + " from " + repository.getUrl() + " was cached in the local repository. " throw new ResourceDoesNotExistException( "Failure to resolve " + remotePath + " from " + repository.getUrl() + " was cached in the local repository. "
throw new TransferFailedException( "Unsupported Protocol: '" + protocol + "': " + e.getMessage(), e ); throw new TransferFailedException( "Connection failed: " + e.getMessage(), e ); throw new TransferFailedException( "Authentication failed: " + e.getMessage(), e ); throw new TransferFailedException( "Resource to deploy not found: " + e.getMessage(), e );
+ repository.getUrl() + "): " + e.getMessage(); throw new ResourceDoesNotExistException( "Unable to download the artifact from any repository" );
@Override public InputStream retrieve( String name ) throws IOException, FileNotFoundException { try { log.info( "index update retrieve file, name:{}", name ); Path file = tempIndexDirectory.resolve( name ); Files.deleteIfExists( file ); file.toFile( ).deleteOnExit( ); wagon.get( addParameters( name, remoteRepository ), file.toFile( ) ); return Files.newInputStream( file ); } catch ( AuthorizationException | TransferFailedException e ) { throw new IOException( e.getMessage( ), e ); } catch ( ResourceDoesNotExistException e ) { FileNotFoundException fnfe = new FileNotFoundException( e.getMessage( ) ); fnfe.initCause( e ); throw fnfe; } }
e.printStackTrace(); System.exit( 4 ); e.printStackTrace(); System.exit( 5 );
public void get(String resourceName, File destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource res = new Resource( resourceName ); try { fireGetInitiated( res, destination ); fireGetStarted( res, destination ); Map m = new HashMap(); destination.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(destination); try { queryRepo.getFile(combine(rootPath,resourceName),-1/*head*/,m, fos); } finally { fos.close(); } postProcessListeners( res, destination, TransferEvent.REQUEST_GET ); fireGetCompleted( res, destination ); } catch (SVNException e) { throw new ResourceDoesNotExistException("Unable to find "+resourceName+" in "+getRepository().getUrl(),e); } catch (IOException e) { throw new TransferFailedException("Unable to find "+resourceName+" in "+getRepository().getUrl(),e); } }