本文整理汇总了Java中com.ibm.commons.Platform类的典型用法代码示例。如果您正苦于以下问题:Java Platform类的具体用法?Java Platform怎么用?Java Platform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Platform类属于com.ibm.commons包,在下文中一共展示了Platform类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResource
import com.ibm.commons.Platform; //导入依赖的package包/类
@Override
public Resource getResource(HttpServletRequest request, String name) {
if(StringUtil.isNotEmpty(name) && name.startsWith("/"+DWA_PREFIX)){
String enableVersion = Platform.getInstance().getProperty("xsp.extlib.enableVersion"); // $NON-NLS-1$
if (StringUtil.equals(enableVersion, "true")) { // $NON-NLS-1$
if (name.startsWith("/" + DWA_PREFIX + "-"+ ExtlibVersion.getCurrentVersionString())) // $NON-NLS-1$
name = name.replace("/" + DWA_PREFIX + "-"+ ExtlibVersion.getCurrentVersionString(),"/.dwa"); // $NON-NLS-1$ // $NON-NLS-2$ // $NON-NLS-3$
else if(name.startsWith("/"+DWA_PREFIX+"-")){ // $NON-NLS-1$ // $NON-NLS-2$
if(ExtlibDominoLogger.DOMINO.isWarnEnabled()){
// warnMessage = "Cannot find URL "+ name +". Version "+ name.substring(name.indexOf("-"), name.indexOf("/", 1))+" is not available. The current version is "+ExtlibVersion.getCurrentVersionString()+".";
String warnMessage = "Cannot find URL {0}. Version {1} is not available. The current extlib version is {2}."; // $NLW-DominoResourceProvider.CannotfindURL0Version1isnotavaila-1$
String urlVersion = name.substring(name.indexOf("-"), name.indexOf("/", 1));
warnMessage = StringUtil.format(warnMessage, name, urlVersion, ExtlibVersion.getCurrentVersionString());
ExtlibDominoLogger.DOMINO.warnp(this, "getResource", // $NON-NLS-1$
warnMessage);
}
}
}
}
return super.getResource(request, name);
}
示例2: getResource
import com.ibm.commons.Platform; //导入依赖的package包/类
@Override
public Resource getResource(HttpServletRequest request, String name) {
if(StringUtil.isNotEmpty(name) && name.startsWith("/"+EXTLIB_PREFIX)){
String enableVersion = Platform.getInstance().getProperty("xsp.extlib.enableVersion"); // $NON-NLS-1$
if (StringUtil.equals(enableVersion, "true")) { // $NON-NLS-1$
if (name.startsWith("/" + EXTLIB_PREFIX + "-"+ ExtlibVersion.getCurrentVersionString())) // $NON-NLS-1$
name = name.replace("/" + EXTLIB_PREFIX + "-"+ ExtlibVersion.getCurrentVersionString(),"/.extlib"); // $NON-NLS-1$ // $NON-NLS-2$ // $NON-NLS-3$
else if(name.startsWith("/"+EXTLIB_PREFIX+"-")){ // $NON-NLS-1$ // $NON-NLS-2$
if(ExtlibCoreLogger.COMPONENT_DATA.isWarnEnabled()){
// warnMessage = "Cannot find URL "+ name +". Version "+ name.substring(name.indexOf("-"), name.indexOf("/", 1))+" is not available. The current version is "+ExtlibVersion.getCurrentVersionString()+".";
String warnMessage = "Cannot find URL {0}. Version {1} is not available. The current version is {2}."; // $NLW-ExtlibResourceProvider.CannotfindURL0Version1isnotavaila-1$
String urlVersion = name.substring(name.indexOf("-"), name.indexOf("/", 1));
warnMessage = StringUtil.format(warnMessage, name, urlVersion, ExtlibVersion.getCurrentVersionString());
ExtlibCoreLogger.COMPONENT_DATA.warnp(this, "getResource", // $NON-NLS-1$
warnMessage);
}
}
}
}
return super.getResource(request, name);
}
示例3: removeInstall
import com.ibm.commons.Platform; //导入依赖的package包/类
private void removeInstall(File file) {
try {
// Note this might left some empty directories, but at least of the files
// will be removed...
BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); // $NON-NLS-1$
try {
for (String s = r.readLine(); s != null; s = r.readLine()) {
if (StringUtil.isNotEmpty(s)) {
File f = new File(installDirectory, s);
f.delete();
}
}
} finally {
r.close();
}
file.delete();
} catch (IOException ex) {
Platform.getInstance().log(ex);
}
}
示例4: parseConfiguration
import com.ibm.commons.Platform; //导入依赖的package包/类
protected static OneUIApplicationConfiguration parseConfiguration(String path) {
FacesContext ctx = FacesContext.getCurrentInstance();
InputStream is = ctx.getExternalContext().getResourceAsStream(path);
if(is!=null) {
try {
try {
Reader reader = new InputStreamReader(is,"UTF-8"); // $NON-NLS-1$
OneUIJSONFactory factory = new OneUIJSONFactory();
return (OneUIApplicationConfiguration)JsonParser.fromJson(factory, reader);
} finally {
is.close();
}
} catch(Exception ex) {
Platform.getInstance().log(ex);
}
}
return null;
}
示例5: initPlatform
import com.ibm.commons.Platform; //导入依赖的package包/类
public static void initPlatform(AbstractXspTest test, File dominoInstallLocation){
Map<String, Object> localVars = test.getTestLocalVars();
if( null != localVars.get("platform") ){
throw new RuntimeException("Platform already exists");
}
Platform defaultPlatformInstance = Platform.getInstance();
Class<?> defaultPlatformClass = defaultPlatformInstance.getClass();
// verify public zero-arg constructor, so will be able to recreate later
try {
defaultPlatformClass.newInstance();
}
catch (Exception e) {
throw new RuntimeException("Will not be able to re-set the platform to a "+defaultPlatformClass, e);
}
TestFrameworkPlatform platform = new TestFrameworkPlatform(dominoInstallLocation);
// verify the platform constructor initialized itself as *the* platform
if( platform != Platform.getInstance() ){
throw new RuntimeException("Problem setting TestFrameworkPlatform");
}
localVars.put("platform", platform);
localVars.put("platformShadowedClass", defaultPlatformClass);
}
示例6: initializeParameters
import com.ibm.commons.Platform; //导入依赖的package包/类
@Override
public void initializeParameters(FacesContext context, RequestParameters parameter) {
parameter.setResourcesProvider(ExtlibRequestCustomizer.instance);
String enableVersion = Platform.getInstance().getProperty("xsp.extlib.enableVersion"); // $NON-NLS-1$
if(StringUtil.equals(enableVersion, "true")) { // $NON-NLS-1${
ExtlibRequestCustomizer rc= new ExtlibRequestCustomizer();
parameter.setUrlProcessor(rc);
}
}
示例7: next
import com.ibm.commons.Platform; //导入依赖的package包/类
public Object next() {
if( current<length ) {
try {
return value.getArrayValue(current++);
} catch(InterpretException ex) {
Platform.getInstance().log(ex);
}
}
return null;
}
示例8: DocumentMap
import com.ibm.commons.Platform; //导入依赖的package包/类
public DocumentMap(DumpContext dumpContext, Document doc) {
super(dumpContext,"Domino Document"); // $NON-NLS-1$
try {
addCategory("Meta Data"); // $NON-NLS-1$
addValue("Note ID", doc.getNoteID()); // $NON-NLS-1$
addValue("UNID", doc.getUniversalID()); // $NON-NLS-1$
addValue("Parent UNID", doc.getParentDocumentUNID()); // $NON-NLS-1$
addCategory("Items"); // $NON-NLS-1$
Vector items = doc.getItems();
for(int i=0; i<items.size(); i++) {
Item it = (Item)items.get(i);
addValue("["+it.getName()+"]", it.getText());
}
addCategory("Timestamps"); // $NON-NLS-1$
addValue("Created", doc.getCreated()); // $NON-NLS-1$
addValue("Last Modified", doc.getLastModified()); // $NON-NLS-1$
addValue("Last Accessed", doc.getLastAccessed()); // $NON-NLS-1$
addValue("Authors", doc.getAuthors()); // $NON-NLS-1$
addCategory("URLs"); // $NON-NLS-1$
addValue("URL", doc.getURL()); // $NON-NLS-1$
addValue("HTTP URL", doc.getHttpURL()); // $NON-NLS-1$
} catch(NotesException ex) {
Platform.getInstance().log(ex);
addValue("NotesException", ex.toString()); // $NON-NLS-1$
}
}
示例9: isDefaultProvider
import com.ibm.commons.Platform; //导入依赖的package包/类
@Override
public boolean isDefaultProvider() {
// If running on Notes/Domino, then we become a default provider
if(Platform.getInstance() instanceof AbstractNotesDominoPlatform) {
return true;
}
return super.isDefaultProvider();
}
示例10: recycle
import com.ibm.commons.Platform; //导入依赖的package包/类
@Override
public void recycle() {
if(view!=null && shouldRecycleView) {
try {
view.recycle();
view = null;
} catch(NotesException ex) {
Platform.getInstance().log(ex);
}
}
super.recycle();
}
示例11: recycle
import com.ibm.commons.Platform; //导入依赖的package包/类
@Override
public void recycle() {
if(document!=null && shouldRecycleDocument) {
try {
document.recycle();
document = null;
} catch(NotesException ex) {
Platform.getInstance().log(ex);
}
}
super.recycle();
}
示例12: startInstall
import com.ibm.commons.Platform; //导入依赖的package包/类
public void startInstall() throws IOException {
// Remove the existing install of the library
removeInstall();
// And prepare the installer
String fileName = library + "-" + version;
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(installDirectory,fileName)),"UTF-8")); // $NON-NLS-1$
String log = StringUtil.format("Installing custom resources for library {0}",fileName); // $NLX-ResourceInstaller.Installingcustomresourcesforlibra-1$
Platform.getInstance().log(log);
System.out.println(log);
}
示例13: toString
import com.ibm.commons.Platform; //导入依赖的package包/类
public String toString() {
try {
return JsonGenerator.toJson(JsonJavaFactory.instance, this);
} catch(Exception ex) {
Platform.getInstance().log(ex);
return "";
}
}
示例14: isDatabaseInitialized
import com.ibm.commons.Platform; //导入依赖的package包/类
public boolean isDatabaseInitialized() throws SQLException {
try {
return JdbcUtil.tableExists(getConnection(), getSchema());
} catch(Exception ex) {
Platform.getInstance().log(ex);
return false;
}
}
示例15: listTables
import com.ibm.commons.Platform; //导入依赖的package包/类
public List<String> listTables() {
try {
return JdbcUtil.listTables(getConnection(), getSchema(), null);
} catch(Exception ex) {
Platform.getInstance().log(ex);
return Collections.<String>emptyList();
}
}