本文整理汇总了Java中org.globus.ftp.MlsxEntry类的典型用法代码示例。如果您正苦于以下问题:Java MlsxEntry类的具体用法?Java MlsxEntry怎么用?Java MlsxEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MlsxEntry类属于org.globus.ftp包,在下文中一共展示了MlsxEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMlst
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
public void testMlst() throws Exception {
logger.info("test MLST");
GridFTPClient src = new GridFTPClient(TestEnv.serverAHost, TestEnv.serverAPort);
src.setAuthorization(TestEnv.getAuthorization(TestEnv.serverASubject));
src.authenticate(null); // use default creds
src.setType(Session.TYPE_ASCII);
src.changeDir(TestEnv.serverADir);
MlsxEntry entry = src.mlst(TestEnv.serverAFile);
logger.debug(entry.toString());
assertEquals(MlsxEntry.TYPE_FILE, entry.get(MlsxEntry.TYPE));
assertEquals(String.valueOf(TestEnv.serverAFileSize),
entry.get(MlsxEntry.SIZE));
assertEquals(TestEnv.serverAFile, entry.getFileName());
src.close();
}
示例2: test3
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
public void test3() throws Exception {
logger.info("show mlsd output using GridFTPClient");
GridFTPClient src = new GridFTPClient(TestEnv.serverAHost, TestEnv.serverAPort);
src.setAuthorization(TestEnv.getAuthorization(TestEnv.serverASubject));
src.authenticate(null); // use default creds
src.setType(Session.TYPE_ASCII);
src.changeDir(TestEnv.serverADir);
Vector v = src.mlsd();
logger.debug("mlsd received");
while (!v.isEmpty()) {
MlsxEntry f = (MlsxEntry) v.remove(0);
logger.info(f.toString());
}
src.close();
}
示例3: getAttributes
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
@Override
public Attribute[] getAttributes(String names[]) throws VrsException
{
if (names == null)
return null;
Attribute attrs[] = new Attribute[names.length];
// Optimized getAttribute: use single entry for all
MlsxEntry entry = this.getMlsxEntry();
for (int i = 0; i < names.length; i++)
{
attrs[i] = getAttribute(entry, names[i]);
}
return attrs;
}
示例4: getAttribute
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
/**
* Optimized method. When fetching multiple attributes, do not refetch the mlsxentry for each attribute.
*
* @param name
* @param update
* @return
* @throws VrsException
*/
public Attribute getAttribute(MlsxEntry entry, String name) throws VrsException
{
// is possible due to optimization:
if (name == null)
return null;
// get Gftp specific attribute and update
// the mslxEntry if needed
Attribute attr = GftpFileSystem.getAttribute(entry, name);
if (attr != null)
return attr;
return super.getAttribute(name);
}
示例5: addHashedMslx
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
private static void addHashedMslx(
Hashtable<String, MlsxEntry> entrys, String path,
FileInfo finf)
{
String name = finf.getName();
String filepath = path + "/" + name;
MlsxEntry mslx = createMslx(filepath, finf);
// put info there overwriting optional previous with same name:
if (mslx != null)
entrys.put(name, mslx);
else
{
logger.errorPrintf("fakeMlsd(): NULL Mslx for:%s\n", filepath);
}
}
示例6: getChild
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
public VFSNode getChild(String filepath) throws VrsException
{
MlsxEntry entry = mlst(filepath);
if (entry == null)
return null;
if (_isDir(entry) == true)
{
return new GftpDir(this, filepath, entry);
}
else
{
return new GftpFile(this, filepath, entry);
}
}
示例7: _getLength
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
public static long _getLength(MlsxEntry entry)
{
// gftp 1.0 hack:
if (entry == null)
return -1;
String val = entry.get(MlsxEntry.SIZE);
// debug("_getLength val=" + val);
if (val == null)
{
// debug("SIZE=null in entry:" + entry);
return 0;
}
long lval = Long.valueOf(val);
return lval;
}
示例8: _getUnique
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
public static String _getUnique(MlsxEntry entry)
{
// gftp 1.0 hack:
if (entry == null)
return "";
String val = entry.get(MlsxEntry.UNIQUE);
// debug("_getUnique val=" + val);
if (val == null)
{
// debug("UNIQUE=null in entry:" + entry);
return null;
}
return val;
// long lval = Long.valueOf(val);
// return lval;
}
示例9: _getModificationTime
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
public static long _getModificationTime(MlsxEntry entry)
{
// gftp 1.0 hack:
if (entry == null)
return -1;
String val = entry.get(MlsxEntry.MODIFY);
// /debug("_getModificationTime val=" + val);
if (val == null)
{
// debug("SIZE=null in entry:" + entry);
return 0;
}
return timeStringToMillis(val);
}
示例10: _getCreationTime
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
public static long _getCreationTime(MlsxEntry entry)
{
// gftp 1.0 hack:
if (entry == null)
return -1;
String val = entry.get(MlsxEntry.CREATE);
// debug("_getCreationTime val=" + val);
if (val == null)
{
// debug("CREATE=null in entry:" + entry);
return 0;
}
return timeStringToMillis(val);
}
示例11: _getGroup
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
private static String _getGroup(MlsxEntry entry)
{
// gftp 1.0 hack:
if (entry == null)
return null;
String val = entry.get(UNIX_GROUP);
// debug("_getModificationTime val=" + val);
if (val == null)
{
// debug("UNIX_GROUP=null in entry:" + entry);
return null;
}
return val;
}
示例12: _getOwner
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
private static String _getOwner(MlsxEntry entry)
{
// gftp 1.0 hack:
if (entry == null)
return null;
String val = entry.get(UNIX_OWNER);
// debug("_getModificationTime val=" + val);
if (val == null)
{
// debug("UNIX_GROUP=null in entry:" + entry);
return null;
}
return val;
}
示例13: convertEntry
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
private GridFile convertEntry(MlsxEntry entry, String apn) {
GridFileImpl gfi = new GridFileImpl();
gfi.setName(entry.getFileName());
gfi.setAbsolutePathName(apn+"/"+entry.getFileName());
String perm = entry.get("unix.mode");
if (perm != null) {
gfi.setUserPermissions(new UnixPermissionsImpl(perm.charAt(1)));
gfi.setGroupPermissions(new UnixPermissionsImpl(perm.charAt(2)));
gfi.setAllPermissions(new UnixPermissionsImpl(perm.charAt(3)));
}
try {
gfi.setLastModified(new SimpleDateFormat().parse(entry.get("modify")));
}
catch (ParseException ex) {
gfi.setLastModified(new Date(0));
}
gfi.setSize(Long.parseLong(entry.get("size")));
String type = entry.get("type");
if ("dir".equals(type)) {
gfi.setFileType(GridFile.DIRECTORY);
}
else if ("file".equals(type)) {
gfi.setFileType(GridFile.FILE);
}
else if ("pdir".equals(type)) {
// gfi.setFileType(GridFile.DIRECTORY);
return null;
}
else if ("cdir".equals(type)) {
// gfi.setFileType(GridFile.DIRECTORY);
return null;
}
else {
gfi.setFileType(GridFile.UNKNOWN);
}
return gfi;
}
示例14: createGridFile
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
private GridFile createGridFile(MlsxEntry e) throws FileResourceException {
GridFile gridFile = new GridFileImpl();
String directory = getCurrentDirectory();
if (directory.endsWith("/")) {
gridFile.setAbsolutePathName(directory + e.getFileName());
}
else {
gridFile.setAbsolutePathName(directory + "/" + e.getFileName());
}
try {
gridFile.setLastModified(new SimpleDateFormat().parse(e.get(MlsxEntry.MODIFY)));
}
catch (ParseException ex) {
gridFile.setLastModified(new Date(0));
}
String type = e.get(MlsxEntry.TYPE);
if (MlsxEntry.TYPE_FILE.equals(type)) {
gridFile.setFileType(GridFile.FILE);
}
if (MlsxEntry.TYPE_DIR.equals(type) || MlsxEntry.TYPE_PDIR.equals(type)
|| MlsxEntry.TYPE_CDIR.equals(type)) {
gridFile.setFileType(GridFile.DIRECTORY);
}
gridFile.setName(e.getFileName());
gridFile.setSize(Long.parseLong(e.get(MlsxEntry.SIZE)));
return gridFile;
}
示例15: test4
import org.globus.ftp.MlsxEntry; //导入依赖的package包/类
public void test4() throws Exception {
logger.info("get mlsd output using GridFTPClient, EBlock, Image");
GridFTPClient src = new GridFTPClient(TestEnv.serverAHost, TestEnv.serverAPort);
src.setAuthorization(TestEnv.getAuthorization(TestEnv.serverASubject));
src.authenticate(null); // use default creds
src.setType(Session.TYPE_IMAGE);
src.setMode(GridFTPSession.MODE_EBLOCK);
// server sends the listing over data channel.
// so in EBlock, it must be active
HostPort hp = src.setLocalPassive();
src.setActive(hp);
src.changeDir(TestEnv.serverADir);
Vector v = src.mlsd();
logger.debug("mlsd received");
while (!v.isEmpty()) {
MlsxEntry f = (MlsxEntry) v.remove(0);
logger.debug(f.toString());
}
src.close();
}