本文整理了Java中com.jcraft.jsch.ChannelSftp.glob_remote()
方法的一些代码示例,展示了ChannelSftp.glob_remote()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ChannelSftp.glob_remote()
方法的具体详情如下:
包路径:com.jcraft.jsch.ChannelSftp
类名称:ChannelSftp
方法名:glob_remote
暂无
代码示例来源:origin: org.xbib/jsch-core
/**
* This method will check if the given string can be expanded to the
* unique string. If it can be expanded to mutiple files, SftpException
* will be thrown.
*
* @return the returned string is unquoted.
*/
private String isUnique(String path) throws Exception {
List<String> v = glob_remote(path);
if (v.size() != 1) {
throw new SftpException(SSH_FX_FAILURE, path + " is not unique: " + v.toString());
}
return v.get(0);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsch
/**
* This method will check if the given string can be expanded to the
* unique string. If it can be expanded to mutiple files, SftpException
* will be thrown.
* @return the returned string is unquoted.
*/
private String isUnique(String path) throws SftpException, Exception{
Vector v=glob_remote(path);
if(v.size()!=1){
throw new SftpException(SSH_FX_FAILURE, path+" is not unique: "+v.toString());
}
return (String)(v.elementAt(0));
}
代码示例来源:origin: org.mule.jsch/jsch
/**
* This method will check if the given string can be expanded to the
* unique string. If it can be expanded to mutiple files, SftpException
* will be thrown.
* @return the returned string is unquoted.
*/
private String isUnique(String path) throws SftpException, Exception{
Vector v=glob_remote(path);
if(v.size()!=1){
throw new SftpException(SSH_FX_FAILURE, path+" is not unique: "+v.toString());
}
return (String)(v.elementAt(0));
}
代码示例来源:origin: com.jcraft.jsch/com.springsource.com.jcraft.jsch
/**
* This method will check if the given string can be expanded to the
* unique string. If it can be expanded to mutiple files, SftpException
* will be thrown.
* @return the returned string is unquoted.
*/
private String isUnique(String path) throws SftpException, Exception{
Vector v=glob_remote(path);
if(v.size()!=1){
throw new SftpException(SSH_FX_FAILURE, path+" is not unique: "+v.toString());
}
return (String)(v.elementAt(0));
}
代码示例来源:origin: ePaul/jsch-documentation
/**
* This method will check if the given string can be expanded to the
* unique string. If it can be expanded to mutiple files, SftpException
* will be thrown.
* @return the returned string is unquoted.
*/
private String isUnique(String path) throws SftpException, Exception{
Vector v=glob_remote(path);
if(v.size()!=1){
throw new SftpException(SSH_FX_FAILURE, path+" is not unique: "+v.toString());
}
return (String)(v.elementAt(0));
}
代码示例来源:origin: com.jcraft.jsch/com.springsource.com.jcraft.jsch
public void setStat(String path, SftpATTRS attr) throws SftpException{
try{
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
private void _setStat(String path, SftpATTRS attr) throws SftpException{
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsch
public void setStat(String path, SftpATTRS attr) throws SftpException{
try{
((MyPipedInputStream)io_in).updateReadSide();
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
private void _setStat(String path, SftpATTRS attr) throws SftpException{
代码示例来源:origin: org.mule.jsch/jsch
public void setStat(String path, SftpATTRS attr) throws SftpException{
try{
((MyPipedInputStream)io_in).updateReadSide();
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
private void _setStat(String path, SftpATTRS attr) throws SftpException{
代码示例来源:origin: org.xbib/jsch-core
public void setStat(String path, SftpATTRS attr) throws SftpException {
try {
((MyPipedInputStream) io_in).updateReadSide();
path = remoteAbsolutePath(path);
List<String> v = glob_remote(path);
for (String aV : v) {
path = aV;
_setStat(path, attr);
}
} catch (Exception e) {
if (e instanceof SftpException) {
throw (SftpException) e;
}
throw new SftpException(SSH_FX_FAILURE, "", e);
}
}
代码示例来源:origin: com.jcraft.jsch/com.springsource.com.jcraft.jsch
public void chgrp(int gid, String path) throws SftpException{
try{
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
SftpATTRS attr=_stat(path);
attr.setFLAGS(0);
attr.setUIDGID(attr.uid, gid);
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
代码示例来源:origin: com.jcraft.jsch/com.springsource.com.jcraft.jsch
public void chown(int uid, String path) throws SftpException{
try{
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
SftpATTRS attr=_stat(path);
attr.setFLAGS(0);
attr.setUIDGID(uid, attr.gid);
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
代码示例来源:origin: com.jcraft.jsch/com.springsource.com.jcraft.jsch
public void chmod(int permissions, String path) throws SftpException{
try{
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
SftpATTRS attr=_stat(path);
attr.setFLAGS(0);
attr.setPERMISSIONS(permissions);
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
代码示例来源:origin: com.jcraft.jsch/com.springsource.com.jcraft.jsch
public void setMtime(String path, int mtime) throws SftpException{
try{
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
SftpATTRS attr=_stat(path);
attr.setFLAGS(0);
attr.setACMODTIME(attr.getATime(), mtime);
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsch
public void chgrp(int gid, String path) throws SftpException{
try{
((MyPipedInputStream)io_in).updateReadSide();
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
SftpATTRS attr=_stat(path);
attr.setFLAGS(0);
attr.setUIDGID(attr.uid, gid);
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
代码示例来源:origin: org.mule.jsch/jsch
public void chmod(int permissions, String path) throws SftpException{
try{
((MyPipedInputStream)io_in).updateReadSide();
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
SftpATTRS attr=_stat(path);
attr.setFLAGS(0);
attr.setPERMISSIONS(permissions);
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsch
public void setMtime(String path, int mtime) throws SftpException{
try{
((MyPipedInputStream)io_in).updateReadSide();
path=remoteAbsolutePath(path);
Vector v=glob_remote(path);
int vsize=v.size();
for(int j=0; j<vsize; j++){
path=(String)(v.elementAt(j));
SftpATTRS attr=_stat(path);
attr.setFLAGS(0);
attr.setACMODTIME(attr.getATime(), mtime);
_setStat(path, attr);
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
代码示例来源:origin: org.xbib/jsch-core
public void setMtime(String path, int mtime) throws SftpException {
try {
((MyPipedInputStream) io_in).updateReadSide();
path = remoteAbsolutePath(path);
List<String> v = glob_remote(path);
int vsize = v.size();
for (String aV : v) {
path = aV;
SftpATTRS attr = _stat(path);
attr.setFLAGS(0);
attr.setACMODTIME(attr.getATime(), mtime);
_setStat(path, attr);
}
} catch (Exception e) {
if (e instanceof SftpException) {
throw (SftpException) e;
}
throw new SftpException(SSH_FX_FAILURE, "", e);
}
}
代码示例来源:origin: org.xbib/jsch-core
public void chgrp(int gid, String path) throws SftpException {
try {
((MyPipedInputStream) io_in).updateReadSide();
path = remoteAbsolutePath(path);
List<String> v = glob_remote(path);
for (String aV : v) {
path = aV;
SftpATTRS attr = _stat(path);
attr.setFLAGS(0);
attr.setUIDGID(attr.uid, gid);
_setStat(path, attr);
}
} catch (Exception e) {
if (e instanceof SftpException) {
throw (SftpException) e;
}
throw new SftpException(SSH_FX_FAILURE, "", e);
}
}
代码示例来源:origin: org.xbib/jsch-core
public void chown(int uid, String path) throws SftpException {
try {
((MyPipedInputStream) io_in).updateReadSide();
path = remoteAbsolutePath(path);
List<String> v = glob_remote(path);
for (String aV : v) {
path = aV;
SftpATTRS attr = _stat(path);
attr.setFLAGS(0);
attr.setUIDGID(uid, attr.gid);
_setStat(path, attr);
}
} catch (Exception e) {
if (e instanceof SftpException) {
throw (SftpException) e;
}
throw new SftpException(SSH_FX_FAILURE, "", e);
}
}
代码示例来源:origin: org.xbib/jsch-core
public void chmod(int permissions, String path) throws SftpException {
try {
((MyPipedInputStream) io_in).updateReadSide();
path = remoteAbsolutePath(path);
List<String> v = glob_remote(path);
for (String aV : v) {
path = aV;
SftpATTRS attr = _stat(path);
attr.setFLAGS(0);
attr.setPERMISSIONS(permissions);
_setStat(path, attr);
}
} catch (Exception e) {
if (e instanceof SftpException) {
throw (SftpException) e;
}
throw new SftpException(SSH_FX_FAILURE, "", e);
}
}
内容来源于网络,如有侵权,请联系作者删除!