当前位置: 首页>>代码示例>>Java>>正文


Java WebFileIO类代码示例

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


WebFileIO类属于com.helger.photon.basic.app.io包,在下文中一共展示了WebFileIO类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startServer

import com.helger.photon.basic.app.io.WebFileIO; //导入依赖的package包/类
@BeforeClass
public static void startServer () throws Exception
{
  if (_isRunJetty ())
  {
    final int nPort = _getJettyPort ();
    s_aJetty = new JettyRunner ("AS4 Mock Jetty");
    s_aJetty.setPort (nPort).setStopPort (nPort + 1000).setAllowAnnotationBasedConfig (false);
    s_aJetty.startServer ();
  }
  else
  {
    s_aJetty = null;
    WebScopeManager.onGlobalBegin (MockServletContext.create ());
    final File aSCPath = new File ("target/junittest").getAbsoluteFile ();
    WebFileIO.initPaths (new File (AS4ServerConfiguration.getDataPath ()).getAbsoluteFile (),
                         aSCPath.getAbsolutePath (),
                         false);
    GlobalIDFactory.setPersistentIntIDFactory (new FileIntIDFactory (WebFileIO.getDataIO ().getFile ("ids.dat")));
  }
  RequestTracker.getInstance ().getRequestTrackingMgr ().setLongRunningCheckEnabled (false);
  s_aResMgr = new AS4ResourceManager ();
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:24,代码来源:MockJettySetup.java

示例2: shutDownServer

import com.helger.photon.basic.app.io.WebFileIO; //导入依赖的package包/类
@AfterClass
public static void shutDownServer () throws Exception
{
  if (s_aResMgr != null)
    s_aResMgr.close ();
  if (_isRunJetty ())
  {
    if (s_aJetty != null)
    {
      s_aJetty.shutDownServer ();
    }
    s_aJetty = null;
  }
  else
  {
    WebFileIO.resetPaths ();
    WebScopeManager.onGlobalEnd ();
  }
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:20,代码来源:MockJettySetup.java

示例3: PDIndexerManager

import com.helger.photon.basic.app.io.WebFileIO; //导入依赖的package包/类
/**
 * Constructor.<br>
 * Initialized the work item queue, the re-index queue and the dead-queue.<br>
 * Schedules the re-index job.<br>
 * Read all work items persisted to disk. This happens when the application is
 * shutdown while elements are still in the queue.<br>
 * Please note that the queuing of the items might directly trigger the usage
 * of the {@link PDMetaManager#getBusinessCardProvider()} so make sure to call
 * {@link PDMetaManager#setBusinessCardProvider(IPDBusinessCardProvider)}
 * before calling this method.
 *
 * @param aStorageMgr
 *        Storage manager to used. May not be <code>null</code>.
 * @throws DAOException
 *         If DAO initialization failed
 */
public PDIndexerManager (@Nonnull final IPDStorageManager aStorageMgr) throws DAOException
{
  m_aStorageMgr = ValueEnforcer.notNull (aStorageMgr, "StorageMgr");

  // Remember the file because upon shutdown WebFileIO may already be
  // discarded
  m_aIndexerWorkItemFile = WebFileIO.getDataIO ().getFile ("indexer-work-items.xml");

  m_aReIndexList = new ReIndexWorkItemList ("reindex-work-items.xml");
  m_aDeadList = new ReIndexWorkItemList ("dead-work-items.xml");
  m_aIndexerWorkQueue = new IndexerWorkItemQueue (aQueueItem -> PDIndexExecutor.executeWorkItem (m_aStorageMgr,
                                                                                                 aQueueItem,
                                                                                                 0,
                                                                                                 aSuccessItem -> _onIndexSuccess (aSuccessItem),
                                                                                                 aFailureItem -> _onIndexFailure (aFailureItem)));

  // Schedule re-index job
  m_aTriggerKey = ReIndexJob.schedule (SimpleScheduleBuilder.repeatMinutelyForever (1));

  // remember here
  m_aScheduler = GlobalQuartzScheduler.getInstance ();

  // Read the file - may not be existing
  final IMicroDocument aDoc = MicroReader.readMicroXML (m_aIndexerWorkItemFile);
  if (aDoc != null)
  {
    if (s_aLogger.isDebugEnabled ())
      s_aLogger.debug ("Reading persisted indexer work items from " + m_aIndexerWorkItemFile);

    for (final IMicroElement eItem : aDoc.getDocumentElement ().getAllChildElements (ELEMENT_ITEM))
    {
      final IIndexerWorkItem aWorkItem = MicroTypeConverter.convertToNative (eItem, IndexerWorkItem.class);
      _queueUniqueWorkItem (aWorkItem);
    }

    // Delete the files to ensure it is not read again next startup time
    FileOperationManager.INSTANCE.deleteFile (m_aIndexerWorkItemFile);
  }
}
 
开发者ID:phax,项目名称:peppol-directory,代码行数:56,代码来源:PDIndexerManager.java

示例4: getLuceneIndexDir

import com.helger.photon.basic.app.io.WebFileIO; //导入依赖的package包/类
@Nonnull
public static File getLuceneIndexDir ()
{
  return WebFileIO.getDataIO ().getFile ("lucene-index");
}
 
开发者ID:phax,项目名称:peppol-directory,代码行数:6,代码来源:PDLucene.java


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