Tabnine Logo
SFTPEngine.setAttributes
Code IndexAdd Tabnine to your IDE (free)

How to use
setAttributes
method
in
net.schmizz.sshj.sftp.SFTPEngine

Best Java code snippets using net.schmizz.sshj.sftp.SFTPEngine.setAttributes (Showing top 10 results out of 315)

origin: hierynomus/sshj

public void setattr(String path, FileAttributes attrs)
    throws IOException {
  engine.setAttributes(path, attrs);
}
origin: hierynomus/sshj

private void setAttributes(LocalSourceFile local, String remotePath) throws IOException {
  if (getPreserveAttributes()) {
    engine.setAttributes(remotePath, getAttributes(local));
  }
}
origin: net.schmizz/sshj

public void setattr(String path, FileAttributes attrs)
    throws IOException {
  engine.setAttributes(path, attrs);
}
origin: com.hierynomus/sshj

public void setattr(String path, FileAttributes attrs)
    throws IOException {
  engine.setAttributes(path, attrs);
}
origin: com.hierynomus/sshj

private void setAttributes(LocalSourceFile local, String remotePath) throws IOException {
  if (getPreserveAttributes()) {
    engine.setAttributes(remotePath, getAttributes(local));
  }
}
origin: iterate-ch/cyberduck

@Override
public void setUnixGroup(final Path file, final String group) throws BackgroundException {
  final FileAttributes attr = new FileAttributes.Builder()
      .withUIDGID(0, new Integer(group))
      .build();
  try {
    session.sftp().setAttributes(file.getAbsolute(), attr);
  }
  catch(IOException e) {
    throw new SFTPExceptionMappingService().map("Failure to write attributes of {0}", e, file);
  }
}
origin: iterate-ch/cyberduck

@Override
public void setUnixOwner(final Path file, final String owner) throws BackgroundException {
  final FileAttributes attr = new FileAttributes.Builder()
      .withUIDGID(new Integer(owner), 0)
      .build();
  try {
    session.sftp().setAttributes(file.getAbsolute(), attr);
  }
  catch(IOException e) {
    throw new SFTPExceptionMappingService().map("Failure to write attributes of {0}", e, file);
  }
}
origin: iterate-ch/cyberduck

  @Override
  public void setTimestamp(final Path file, final Long modified) throws BackgroundException {
    try {
      // We must both set the accessed and modified time. See AttribFlags.SSH_FILEXFER_ATTR_V3_ACMODTIME
      // All times are represented as seconds from Jan 1, 1970 in UTC.
      final FileAttributes attrs = new FileAttributes.Builder().withAtimeMtime(
          System.currentTimeMillis() / 1000, modified / 1000
      ).build();
      session.sftp().setAttributes(file.getAbsolute(), attrs);
    }
    catch(IOException e) {
      throw new SFTPExceptionMappingService().map("Cannot change timestamp of {0}", e, file);
    }

  }
}
origin: iterate-ch/cyberduck

  @Override
  public void setUnixPermission(final Path file, final Permission permission) throws BackgroundException {
    final FileAttributes attr = new FileAttributes.Builder()
        .withPermissions(Integer.parseInt(permission.getMode(), 8))
        .build();
    try {
      session.sftp().setAttributes(file.getAbsolute(), attr);
    }
    catch(IOException e) {
      throw new SFTPExceptionMappingService().map("Failure to write attributes of {0}", e, file);
    }
  }
}
origin: net.schmizz/sshj

private void upload(final TransferListener listener,
          final LocalSourceFile local,
          final String remote)
    throws IOException {
  final String adjustedPath;
  if (local.isDirectory()) {
    adjustedPath = uploadDir(listener.directory(local.getName()), local, remote);
  } else if (local.isFile()) {
    adjustedPath = uploadFile(listener.file(local.getName(), local.getLength()), local, remote);
  } else
    throw new IOException(local + " is not a file or directory");
  if (getPreserveAttributes())
    engine.setAttributes(adjustedPath, getAttributes(local));
}
net.schmizz.sshj.sftpSFTPEnginesetAttributes

Popular methods of SFTPEngine

  • open
  • makeDir
  • stat
  • <init>
  • canonicalize
  • close
  • getOperativeProtocolVersion
  • getPathHelper
  • getSubsystem
  • init
  • lstat
  • openDir
  • lstat,
  • openDir,
  • readLink,
  • remove,
  • removeDir,
  • rename,
  • request,
  • symlink,
  • doRequest

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JComboBox (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now