本文整理汇总了Java中org.apache.commons.io.FilenameUtils.separatorsToSystem方法的典型用法代码示例。如果您正苦于以下问题:Java FilenameUtils.separatorsToSystem方法的具体用法?Java FilenameUtils.separatorsToSystem怎么用?Java FilenameUtils.separatorsToSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.io.FilenameUtils
的用法示例。
在下文中一共展示了FilenameUtils.separatorsToSystem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTenantScriptLocation
import org.apache.commons.io.FilenameUtils; //导入方法依赖的package包/类
private String getTenantScriptLocation(String path, ContextsHolder contextsHolder) {
String tenantKey = LepContextUtils.getTenantKey(contextsHolder);
switch (tenantScriptStorage) {
case CLASSPATH:
return CLASSPATH_URL_PREFIX + "/lep/custom/" + tenantKey.toLowerCase() + path;
case XM_MS_CONFIG:
return XM_MS_CONFIG_URL_PREFIX + "/config/tenants/" + tenantKey.toUpperCase() + "/"
+ appName + "/lep" + path;
case FILE: {
String lepDir = Paths.get(FileSystemUtils.APP_HOME_DIR, "config", "tenants",
tenantKey.toUpperCase(), appName, "lep").toString();
return "file://" + lepDir + FilenameUtils.separatorsToSystem(path);
}
default:
throw new IllegalStateException("Unsupported tenant script storage type: "
+ tenantScriptStorage);
}
}
示例2: add
import org.apache.commons.io.FilenameUtils; //导入方法依赖的package包/类
@Override
public void add( String name ) {
try {
if ( name.matches( ".*\\.mine$|.*\\.r\\d+$" ) ) { // Resolve a conflict
File conflicted = new File( directory + File.separator + FilenameUtils.separatorsToSystem( FilenameUtils.removeExtension( name ) ) );
FileUtils.rename( new File( directory, name ),
conflicted,
StandardCopyOption.REPLACE_EXISTING );
svnClient.resolved( conflicted );
} else {
svnClient.addFile( new File( directory, name ) );
}
} catch ( Exception e ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
}
}
示例3: diff
import org.apache.commons.io.FilenameUtils; //导入方法依赖的package包/类
@Override
public String diff( String oldCommitId, String newCommitId, String file ) {
AbstractJhlClientAdapter client = (AbstractJhlClientAdapter) svnClient;
OutputStream outStream = new ByteArrayOutputStream();
try {
String target = directory + File.separator + FilenameUtils.separatorsToSystem( file );
ISVNInfo info = svnClient.getInfoFromWorkingCopy( new File( target ) );
if ( info instanceof SVNInfoUnversioned ) {
return "Unversioned";
}
if ( info.getRevision() == null || info.isCopied() ) { // not commited yet or copied
oldCommitId = null;
}
client.getSVNClient().diff(
target,
null, resolveRevision( oldCommitId ), resolveRevision( newCommitId ),
directory.replace( "\\", "/" ), outStream, Depth.infinityOrImmediates( true ), null, true, false, false, true, false, false );
return outStream.toString().replaceAll( "\n", System.getProperty( "line.separator" ) );
} catch ( Exception e ) {
return e.getMessage();
}
}
示例4: open
import org.apache.commons.io.FilenameUtils; //导入方法依赖的package包/类
@Override
public InputStream open( String file, String commitId ) {
try {
if ( commitId.equals( IVCS.WORKINGTREE ) ) {
return new FileInputStream( new File( directory + File.separator + FilenameUtils.separatorsToSystem( file ) ) );
} else if ( commitId.equals( Constants.HEAD ) ) {
return svnClient.getContent( new File( directory + File.separator + FilenameUtils.separatorsToSystem( file ) ),
SVNRevision.HEAD );
} else {
return svnClient.getContent( svnClient.getInfoFromWorkingCopy( root ).getUrl().appendPath( file ),
new SVNRevision.Number( Long.parseLong( commitId ) ) );
}
} catch ( Exception e ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
}
return null;
}