本文整理汇总了Java中org.apache.commons.vfs2.provider.FileNameParser类的典型用法代码示例。如果您正苦于以下问题:Java FileNameParser类的具体用法?Java FileNameParser怎么用?Java FileNameParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileNameParser类属于org.apache.commons.vfs2.provider包,在下文中一共展示了FileNameParser类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: rootPathNoClusterName
import org.apache.commons.vfs2.provider.FileNameParser; //导入依赖的package包/类
@Test
public void rootPathNoClusterName() throws FileSystemException {
final String URI = "maprfs:///";
FileNameParser parser = new MapRFileNameParser();
FileName name = parser.parseUri(null, null, URI);
assertEquals(URI, name.getURI());
assertEquals("maprfs", name.getScheme());
}
开发者ID:pentaho,项目名称:pentaho-hdfs-vfs,代码行数:11,代码来源:MapRFileNameParserTest.java
示例2: withPath
import org.apache.commons.vfs2.provider.FileNameParser; //导入依赖的package包/类
@Test
public void withPath() throws FileSystemException
{
final String URI = "maprfs:///my/file/path";
FileNameParser parser = new MapRFileNameParser();
FileName name = parser.parseUri(null, null, URI);
assertEquals(URI, name.getURI());
assertEquals("maprfs", name.getScheme());
assertEquals("/my/file/path", name.getPath());
}
开发者ID:pentaho,项目名称:pentaho-hdfs-vfs,代码行数:13,代码来源:MapRFileNameParserTest.java
示例3: withPathAndClusterName
import org.apache.commons.vfs2.provider.FileNameParser; //导入依赖的package包/类
@Test
public void withPathAndClusterName() throws FileSystemException {
final String URI = "maprfs://cluster2/my/file/path";
FileNameParser parser = new MapRFileNameParser();
FileName name = parser.parseUri(null, null, URI);
assertEquals(URI, name.getURI());
assertEquals("maprfs", name.getScheme());
assertTrue(name.getURI().startsWith("maprfs://cluster2/"));
assertEquals("/my/file/path", name.getPath());
}
开发者ID:pentaho,项目名称:pentaho-hdfs-vfs,代码行数:13,代码来源:MapRFileNameParserTest.java
示例4: testParseUri_withKeys
import org.apache.commons.vfs2.provider.FileNameParser; //导入依赖的package包/类
@Test
public void testParseUri_withKeys() throws Exception {
FileNameParser parser = S3FileNameParser.getInstance();
String expected = buildS3URL( "/rcf-emr-staging", true );
FileName filename =
parser.parseUri( null, null, "s3://" + awsAccessKey + ":" + awsSecretKey + "@" + HOST + "/rcf-emr-staging" );
assertEquals( expected, filename.getURI() );
}
开发者ID:pentaho,项目名称:pentaho-s3-vfs,代码行数:11,代码来源:S3FileNameParserIT.java
示例5: testParseUri_withoutKeys
import org.apache.commons.vfs2.provider.FileNameParser; //导入依赖的package包/类
@Test
public void testParseUri_withoutKeys() throws Exception {
FileNameParser parser = S3FileNameParser.getInstance();
String expected = buildS3URL( "/", false );
FileName filename = parser.parseUri( null, null, "s3://" + HOST + "/" );
assertEquals( expected, filename.getURI() );
}
开发者ID:pentaho,项目名称:pentaho-s3-vfs,代码行数:10,代码来源:S3FileNameParserIT.java
示例6: getInstance
import org.apache.commons.vfs2.provider.FileNameParser; //导入依赖的package包/类
public static FileNameParser getInstance()
{
return INSTANCE;
}
开发者ID:danniss,项目名称:common-vfs2-nfs,代码行数:5,代码来源:NfsFileNameParser.java
示例7: getInstance
import org.apache.commons.vfs2.provider.FileNameParser; //导入依赖的package包/类
public static FileNameParser getInstance() {
return INSTANCE;
}
开发者ID:pentaho,项目名称:pentaho-hdfs-vfs,代码行数:4,代码来源:HDFSFileNameParser.java
示例8: setParameter
import org.apache.commons.vfs2.provider.FileNameParser; //导入依赖的package包/类
/**
* Publicly expose a generic way to set parameters
*/
@Override
public void setParameter( FileSystemOptions opts, String name, String value, String fullParameterName,
String vfsUrl ) throws IOException {
if ( !fullParameterName.startsWith( "vfs.sftp" ) ) {
// This is not an SFTP parameter. Delegate to the generic handler
super.setParameter( opts, name, value, fullParameterName, vfsUrl );
} else {
// Check for the presence of a host in the full variable name
try {
// Parse server name from vfsFilename
FileNameParser sftpFilenameParser = SftpFileNameParser.getInstance();
URLFileName file = (URLFileName) sftpFilenameParser.parseUri( null, null, vfsUrl );
if ( !parameterContainsHost( fullParameterName ) || fullParameterName.endsWith( file.getHostName() ) ) {
// Match special cases for parameter names
if ( name.equalsIgnoreCase( "AuthKeyPassphrase" ) ) {
setParam( opts, UserInfo.class.getName(), new PentahoUserInfo( value ) );
} else if ( name.equals( "identity" ) ) {
IdentityInfo[] identities = (IdentityInfo[]) this.getParam( opts, IDENTITY_KEY );
if ( identities == null ) {
identities = new IdentityInfo[] { new IdentityInfo( new File( value ) ) };
} else {
// Copy, in a Java 5 friendly manner, identities into a larger array
IdentityInfo[] temp = new IdentityInfo[identities.length + 1];
System.arraycopy( identities, 0, temp, 0, identities.length );
identities = temp;
identities[identities.length - 1] = new IdentityInfo( new File( value ) );
}
setParam( opts, IDENTITY_KEY, identities );
} else {
super.setParameter( opts, name, value, fullParameterName, vfsUrl );
}
} else {
// No host match found
log.logDebug( "No host match found for: " + fullParameterName );
}
} catch ( IOException e ) {
log.logError( "Failed to set VFS parameter: [" + fullParameterName + "] " + value, e );
}
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:48,代码来源:KettleSftpFileSystemConfigBuilder.java
示例9: getInstance
import org.apache.commons.vfs2.provider.FileNameParser; //导入依赖的package包/类
/**
* Gets the single instance of GsiFtpFileNameParser.
*
* @return single instance of GsiFtpFileNameParser
*/
public static FileNameParser getInstance() {
return INSTANCE;
}
开发者ID:clstoulouse,项目名称:motu,代码行数:9,代码来源:GsiFtpFileNameParser.java
注:本文中的org.apache.commons.vfs2.provider.FileNameParser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论