• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Platform类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.ibm.commons.Platform的典型用法代码示例。如果您正苦于以下问题:Java Platform类的具体用法?Java Platform怎么用?Java Platform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Platform类属于com.ibm.commons包,在下文中一共展示了Platform类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
  }
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:22,代码来源:DominoResourceProvider.java


示例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);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:22,代码来源:ExtlibResourceProvider.java


示例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);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:21,代码来源:ResourceInstaller.java


示例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;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:19,代码来源:OneUIApplicationBean.java


示例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);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:TestProject.java


示例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);
	}
	
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:ExtlibRequestCustomizerFactory.java


示例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;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:SimpleValuePickerData.java


示例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$
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:30,代码来源:DominoDumpFactory.java


示例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();
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:9,代码来源:DominoDBUserBeanDataProvider.java


示例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();
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:13,代码来源:RestViewService.java


示例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();
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:13,代码来源:RestDocumentService.java


示例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);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:13,代码来源:ResourceInstaller.java


示例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 "";
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:9,代码来源:JsonSortedObject.java


示例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;
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:9,代码来源:DBUtil.java


示例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();
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:9,代码来源:DBUtil.java


示例16: instantiateDb

import com.ibm.commons.Platform; //导入依赖的package包/类
private static String instantiateDb(final String basename) throws IOException {
	File dbFile = File.createTempFile(basename, ".nsf"); //$NON-NLS-1$
	Platform.getInstance().log("{0} location is {1}", basename, dbFile.getAbsolutePath()); //$NON-NLS-1$
	FileOutputStream fos = new FileOutputStream(dbFile);
	InputStream is = AllTests.class.getResourceAsStream("/" + basename + ".nsf"); //$NON-NLS-1$ //$NON-NLS-2$
	StreamUtil.copyStream(is, fos);
	fos.flush();
	StreamUtil.close(fos);
	StreamUtil.close(is);
	return dbFile.getAbsolutePath();
}
 
开发者ID:jesse-gallagher,项目名称:XPages-Scaffolding,代码行数:12,代码来源:AllTests.java



注:本文中的com.ibm.commons.Platform类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Database类代码示例发布时间:2022-05-22
下一篇:
Java SimpleAuthenticator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap