本文整理匯總了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;
}