org.apache.maven.wagon.repository.Repository.getPermissions()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(10.1k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.apache.maven.wagon.repository.Repository.getPermissions方法的一些代码示例,展示了Repository.getPermissions的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.getPermissions方法的具体详情如下:
包路径:org.apache.maven.wagon.repository.Repository
类名称:Repository
方法名:getPermissions

Repository.getPermissions介绍

暂无

代码示例

代码示例来源:origin: jcaddel/maven-s3-wagon

protected CannedAccessControlList getAclFromRepository(Repository repository) {
  RepositoryPermissions permissions = repository.getPermissions();
  if (permissions == null) {
    return null;
  }
  String filePermissions = permissions.getFileMode();
  if (StringUtils.isBlank(filePermissions)) {
    return null;
  }
  return CannedAccessControlList.valueOf(filePermissions.trim());
}

代码示例来源:origin: apache/maven-wagon

private void ftpRecursivePut( File sourceFile, String prefix, String fileName, int directoryMode )
  throws TransferFailedException, SftpException
  final RepositoryPermissions permissions = repository.getPermissions();

代码示例来源:origin: org.apache.maven.wagon/wagon-ssh

private void ftpRecursivePut( File sourceFile, String prefix, String fileName, int directoryMode )
  throws TransferFailedException, SftpException
  final RepositoryPermissions permissions = repository.getPermissions();

代码示例来源:origin: io.packagecloud.maven.wagon/maven-packagecloud-wagon

insertKeyValueToBuf(buf, "repository url", getRepository().getUrl());
if (getRepository().getPermissions() != null){
  String dirMode = getRepository().getPermissions().getDirectoryMode();
  String fileMode = getRepository().getPermissions().getFileMode();
  String group = getRepository().getPermissions().getGroup();
  insertKeyValueToBuf(buf, "dirMode", dirMode);
  insertKeyValueToBuf(buf, "fileMode", fileMode);

代码示例来源:origin: org.apache.maven.wagon/wagon-ssh

protected void finishPutTransfer( Resource resource, InputStream input, OutputStream output )
  throws TransferFailedException
{
  try
  {
    sendEom( output );
    checkAck( channelInputStream );
    // This came from SCPClient in Ganymede SSH2. It is sent after all files.
    output.write( END_OF_FILES_MSG.getBytes() );
    output.flush();
  }
  catch ( IOException e )
  {
    handleIOException( resource, e );
  }
  String basedir = getRepository().getBasedir();
  try
  {
    setFileGroup( getRepository().getPermissions(), basedir, resource );
  }
  catch ( CommandExecutionException e )
  {
    fireTransferError( resource, e, TransferEvent.REQUEST_PUT );
    throw new TransferFailedException( e.getMessage(), e );
  }
}

代码示例来源:origin: apache/maven-wagon

protected void finishPutTransfer( Resource resource, InputStream input, OutputStream output )
  throws TransferFailedException
{
  try
  {
    sendEom( output );
    checkAck( channelInputStream );
    // This came from SCPClient in Ganymede SSH2. It is sent after all files.
    output.write( END_OF_FILES_MSG.getBytes() );
    output.flush();
  }
  catch ( IOException e )
  {
    handleIOException( resource, e );
  }
  String basedir = getRepository().getBasedir();
  try
  {
    setFileGroup( getRepository().getPermissions(), basedir, resource );
  }
  catch ( CommandExecutionException e )
  {
    fireTransferError( resource, e, TransferEvent.REQUEST_PUT );
    throw new TransferFailedException( e.getMessage(), e );
  }
}

代码示例来源:origin: org.apache.maven.wagon/wagon-ssh

protected void finishPutTransfer( Resource resource, InputStream input, OutputStream output )
  throws TransferFailedException
{
  RepositoryPermissions permissions = getRepository().getPermissions();
  String filename = ScpHelper.getResourceFilename( resource.getName() );
  if ( permissions != null && permissions.getGroup() != null )
  {
    setGroup( filename, permissions );
  }
  
  if ( permissions != null && permissions.getFileMode() != null )
  {
    setFileMode( filename, permissions );
  }
}

代码示例来源:origin: apache/maven-wagon

protected void finishPutTransfer( Resource resource, InputStream input, OutputStream output )
  throws TransferFailedException
{
  RepositoryPermissions permissions = getRepository().getPermissions();
  String filename = ScpHelper.getResourceFilename( resource.getName() );
  if ( permissions != null && permissions.getGroup() != null )
  {
    setGroup( filename, permissions );
  }
  
  if ( permissions != null && permissions.getFileMode() != null )
  {
    setFileMode( filename, permissions );
  }
}

代码示例来源:origin: apache/maven-wagon

try
  if ( repository.getPermissions() != null )
    String dirPerms = repository.getPermissions().getDirectoryMode();
  RepositoryPermissions permissions = repository.getPermissions();

代码示例来源:origin: org.apache.maven.wagon/wagon-ssh-common

try
  if ( repository.getPermissions() != null )
    String dirPerms = repository.getPermissions().getDirectoryMode();
  RepositoryPermissions permissions = repository.getPermissions();

代码示例来源:origin: org.apache.maven.wagon/wagon-ssh

public void putDirectory( File sourceDirectory, String destinationDirectory )
  throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
{
  final RepositoryPermissions permissions = repository.getPermissions();
  try
  {
    channel.cd( "/" );
    
    String basedir = getRepository().getBasedir();
    int directoryMode = getDirectoryMode( permissions );
    
    mkdirs( basedir + "/", directoryMode );
    
    fireTransferDebug( "Recursively uploading directory " + sourceDirectory.getAbsolutePath() + " as "
      + destinationDirectory );
    
    mkdirs( destinationDirectory, directoryMode );
    ftpRecursivePut( sourceDirectory, null, ScpHelper.getResourceFilename( destinationDirectory ),
             directoryMode );
  }
  catch ( SftpException e )
  {
    String msg =
      "Error occurred while deploying '" + sourceDirectory.getAbsolutePath() + "' " + "to remote repository: "
        + getRepository().getUrl() + ": " + e.getMessage();
    throw new TransferFailedException( msg, e );
  }
}

代码示例来源:origin: apache/maven-wagon

public void putDirectory( File sourceDirectory, String destinationDirectory )
  throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
{
  final RepositoryPermissions permissions = repository.getPermissions();
  try
  {
    channel.cd( "/" );
    
    String basedir = getRepository().getBasedir();
    int directoryMode = getDirectoryMode( permissions );
    
    mkdirs( basedir + "/", directoryMode );
    
    fireTransferDebug( "Recursively uploading directory " + sourceDirectory.getAbsolutePath() + " as "
      + destinationDirectory );
    
    mkdirs( destinationDirectory, directoryMode );
    ftpRecursivePut( sourceDirectory, null, ScpHelper.getResourceFilename( destinationDirectory ),
             directoryMode );
  }
  catch ( SftpException e )
  {
    String msg =
      "Error occurred while deploying '" + sourceDirectory.getAbsolutePath() + "' " + "to remote repository: "
        + getRepository().getUrl() + ": " + e.getMessage();
    throw new TransferFailedException( msg, e );
  }
}

代码示例来源:origin: org.apache.maven.wagon/wagon-ssh

sshTool.createRemoteDirectories( getPath( basedir, dir ), getRepository().getPermissions() );
String octalMode = getOctalMode( getRepository().getPermissions() );

代码示例来源:origin: org.apache.maven.wagon/wagon-ftp

@Override
protected void firePutCompleted( Resource resource, File file )
{
  try
  {
    // TODO [BP]: verify the order is correct
    ftp.completePendingCommand();
    RepositoryPermissions permissions = repository.getPermissions();
    if ( permissions != null && permissions.getGroup() != null )
    {
      // ignore failures
      ftp.sendSiteCommand( "CHGRP " + permissions.getGroup() + " " + resource.getName() );
    }
    if ( permissions != null && permissions.getFileMode() != null )
    {
      // ignore failures
      ftp.sendSiteCommand( "CHMOD " + permissions.getFileMode() + " " + resource.getName() );
    }
  }
  catch ( IOException e )
  {
    // TODO: handle
    // michal I am not sure  what error means in that context
    // I think that we will be able to recover or simply we will fail later on
  }
  super.firePutCompleted( resource, file );
}

代码示例来源:origin: apache/maven-wagon

@Override
protected void firePutCompleted( Resource resource, File file )
{
  try
  {
    // TODO [BP]: verify the order is correct
    ftp.completePendingCommand();
    RepositoryPermissions permissions = repository.getPermissions();
    if ( permissions != null && permissions.getGroup() != null )
    {
      // ignore failures
      ftp.sendSiteCommand( "CHGRP " + permissions.getGroup() + " " + resource.getName() );
    }
    if ( permissions != null && permissions.getFileMode() != null )
    {
      // ignore failures
      ftp.sendSiteCommand( "CHMOD " + permissions.getFileMode() + " " + resource.getName() );
    }
  }
  catch ( IOException e )
  {
    // TODO: handle
    // michal I am not sure  what error means in that context
    // I think that we will be able to recover or simply we will fail later on
  }
  super.firePutCompleted( resource, file );
}

代码示例来源:origin: org.apache.maven.wagon/wagon-ftp

RepositoryPermissions permissions = getRepository().getPermissions();
if ( !makeFtpDirectoryRecursive( getRepository().getBasedir(), permissions ) )

代码示例来源:origin: apache/maven-wagon

RepositoryPermissions permissions = getRepository().getPermissions();
if ( !makeFtpDirectoryRecursive( getRepository().getBasedir(), permissions ) )

代码示例来源:origin: org.apache.maven.wagon/wagon-ssh

public void fillOutputData( OutputData outputData )
  throws TransferFailedException
{
  int directoryMode = getDirectoryMode( getRepository().getPermissions() );
  Resource resource = outputData.getResource();
  
  try
  {
    channel.cd( "/" );
    String basedir = getRepository().getBasedir();
    mkdirs( basedir + "/", directoryMode );
    mkdirs( resource.getName(), directoryMode );
    String filename = ScpHelper.getResourceFilename( resource.getName() );
    outputData.setOutputStream( channel.put( filename ) );
  }
  catch ( TransferFailedException e )
  {
    fireTransferError( resource, e, TransferEvent.REQUEST_PUT );
    throw e;
  }
  catch ( SftpException e )
  {
    fireTransferError( resource, e, TransferEvent.REQUEST_PUT );
    String msg =
      "Error occurred while deploying '" + resource.getName() + "' " + "to remote repository: "
        + getRepository().getUrl() + ": " + e.getMessage();
    throw new TransferFailedException( msg, e );
  }
}

代码示例来源:origin: apache/maven-wagon

public void fillOutputData( OutputData outputData )
  throws TransferFailedException
{
  int directoryMode = getDirectoryMode( getRepository().getPermissions() );
  Resource resource = outputData.getResource();
  
  try
  {
    channel.cd( "/" );
    String basedir = getRepository().getBasedir();
    mkdirs( basedir + "/", directoryMode );
    mkdirs( resource.getName(), directoryMode );
    String filename = ScpHelper.getResourceFilename( resource.getName() );
    outputData.setOutputStream( channel.put( filename ) );
  }
  catch ( TransferFailedException e )
  {
    fireTransferError( resource, e, TransferEvent.REQUEST_PUT );
    throw e;
  }
  catch ( SftpException e )
  {
    fireTransferError( resource, e, TransferEvent.REQUEST_PUT );
    String msg =
      "Error occurred while deploying '" + resource.getName() + "' " + "to remote repository: "
        + getRepository().getUrl() + ": " + e.getMessage();
    throw new TransferFailedException( msg, e );
  }
}

代码示例来源:origin: org.apache.maven.wagon/wagon-ftp

RepositoryPermissions permissions = repository.getPermissions();

相关文章