本文整理匯總了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 ();
}
示例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 ();
}
}
示例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);
}
}
示例4: getLuceneIndexDir
import com.helger.photon.basic.app.io.WebFileIO; //導入依賴的package包/類
@Nonnull
public static File getLuceneIndexDir ()
{
return WebFileIO.getDataIO ().getFile ("lucene-index");
}