本文整理汇总了Java中org.apache.tools.ant.util.StringUtils.removePrefix方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.removePrefix方法的具体用法?Java StringUtils.removePrefix怎么用?Java StringUtils.removePrefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.util.StringUtils
的用法示例。
在下文中一共展示了StringUtils.removePrefix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLabel
import org.apache.tools.ant.util.StringUtils; //导入方法依赖的package包/类
public String getLabel(OWLClass cls) {
Set<OWLAnnotation> annotations = cls.getAnnotations(ont);
for (OWLAnnotation annotation : annotations) {
if (annotation.getProperty().isLabel()) {
String s = annotation.getValue().toString();
s = StringUtils.removePrefix(s, "\"");
s = StringUtils.removeSuffix(s, "\"^^xsd:string");
return s;
}
}
return null;
}
示例2: getNamespace
import org.apache.tools.ant.util.StringUtils; //导入方法依赖的package包/类
public String getNamespace(OWLClass cls) {
Set<OWLAnnotation> annotations = cls.getAnnotations(ont);
for (OWLAnnotation annotation : annotations) {
String propertyUri = getAnnotationPropertyUri(annotation);
if (propertyUri.equals(NAMESPACE_PROP_ALT) || propertyUri.equals(NAMESPACE_PROP)) {
String s = annotation.getValue().toString();
s = StringUtils.removePrefix(s, "\"");
s = StringUtils.removeSuffix(s, "\"^^xsd:string");
return s;
}
}
return null;
}
示例3: copyJarResourcesRecursively
import org.apache.tools.ant.util.StringUtils; //导入方法依赖的package包/类
boolean copyJarResourcesRecursively( final File destDir, final JarURLConnection jarConnection )
throws IOException, MojoExecutionException
{
final JarFile jarFile = jarConnection.getJarFile();
for ( final Enumeration<JarEntry> e = jarFile.entries(); e.hasMoreElements(); )
{
final JarEntry entry = e.nextElement();
if ( entry.getName().startsWith( jarConnection.getEntryName() ) )
{
final String filename = StringUtils.removePrefix( entry.getName(), //
jarConnection.getEntryName() );
final File f = new File( destDir, filename );
if ( !entry.isDirectory() )
{
final InputStream entryInputStream = jarFile.getInputStream( entry );
if ( !copyStream( entryInputStream, f ) )
{
return false;
}
entryInputStream.close();
}
else
{
if ( !ensureDirectoryExists( f ) )
{
throw new IOException( "Could not create directory: "
+ f.getAbsolutePath() );
}
}
}
}
return true;
}