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


Java FileStore类代码示例

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


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

示例1: main

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
public static void main( String[] args ) {
    SwingUtilities.invokeLater(new Runnable(){
        public void run() {
            JFrame frame = new JFrame();
            frame.setPreferredSize(new Dimension(800, 300));
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

            FileStore store = new BasicDataFileStore();
            File cacheRoot = store.getWriteLocation();
            DataCacheViewer viewerPanel = new DataCacheViewer(cacheRoot);
            frame.getContentPane().add(viewerPanel.panel, BorderLayout.CENTER);
            frame.pack();

            // Center the application on the screen.
            Dimension prefSize = frame.getPreferredSize();
            Dimension parentSize;
            java.awt.Point parentLocation = new java.awt.Point(0, 0);
            parentSize = Toolkit.getDefaultToolkit().getScreenSize();
            int x = parentLocation.x + (parentSize.width - prefSize.width) / 2;
            int y = parentLocation.y + (parentSize.height - prefSize.height) / 2;
            frame.setLocation(x, y);
            frame.setVisible(true);
        }
    });
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:26,代码来源:DataCacheViewer.java

示例2: clearCacheBySourceName

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
public static void clearCacheBySourceName( String sourceName ) {
    try {
        FileStore store = new BasicDataFileStore();
        File cacheRoot = store.getWriteLocation();
        List<FileStoreDataSet> dataSets = FileStoreDataSet.getDataSets(cacheRoot);
        for( FileStoreDataSet fileStoreDataSet : dataSets ) {
            String cacheName = fileStoreDataSet.getName();
            if (cacheName.contains(sourceName)) {
                // remove it
                fileStoreDataSet.delete(false);
                break;
            }
        }
    } catch (Exception e1) {
        e1.printStackTrace();
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:18,代码来源:CacheUtils.java

示例3: isTextureFileExpired

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
protected boolean isTextureFileExpired(TextureTile tile, java.net.URL textureURL, FileStore fileStore)
{
	if (!WWIO.isFileOutOfDate(textureURL, tile.getLevel().getExpiryTime()))
		return false;

	// The file has expired. Delete it.
	fileStore.removeFile(textureURL);
	String message = Logging.getMessage("generic.DataFileExpired", textureURL);
	Logging.logger().fine(message);
	return true;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:BasicScalingTiledImageLayer.java

示例4: DownloadPostProcessor

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
public DownloadPostProcessor(TextureTile tile, BasicScalingTiledImageLayer layer, FileStore fileStore)
{
	 //noinspection RedundantCast
    super((AVList) layer);

	this.tile = tile;
	this.layer = layer;
	this.fileStore = fileStore;
	}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:10,代码来源:BasicScalingTiledImageLayer.java

示例5: writeConfigurationFile

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
protected void writeConfigurationFile(FileStore fileStore)
{
    // TODO: configurable max attempts for creating a configuration file.

    try
    {
        AVList configParams = this.getConfigurationParams(null);
        this.writeConfigurationParams(fileStore, configParams);
    }
    catch (Exception e)
    {
        String message = Logging.getMessage("generic.ExceptionAttemptingToWriteConfigurationFile");
        Logging.logger().log(java.util.logging.Level.SEVERE, message, e);
    }
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:16,代码来源:BasicScalingTiledImageLayer.java

示例6: writeConfigurationParams

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
protected void writeConfigurationParams(FileStore fileStore, AVList params)
{
    // Determine what the configuration file name should be based on the configuration parameters. Assume an XML
    // configuration document type, and append the XML file suffix.
    String fileName = DataConfigurationUtils.getDataConfigFilename(params, ".xml");
    if (fileName == null)
    {
        String message = Logging.getMessage("nullValue.FilePathIsNull");
        Logging.logger().severe(message);
        throw new WWRuntimeException(message);
    }

    // Check if this component needs to write a configuration file. This happens outside of the synchronized block
    // to improve multithreaded performance for the common case: the configuration file already exists, this just
    // need to check that it's there and return. If the file exists but is expired, do not remove it -  this
    // removes the file inside the synchronized block below.
    if (!this.needsConfigurationFile(fileStore, fileName, params, false))
        return;

    synchronized (this.fileLock)
    {
        // Check again if the component needs to write a configuration file, potentially removing any existing file
        // which has expired. This additional check is necessary because the file could have been created by
        // another thread while we were waiting for the lock.
        if (!this.needsConfigurationFile(fileStore, fileName, params, true))
            return;

        this.doWriteConfigurationParams(fileStore, fileName, params);
    }
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:31,代码来源:BasicScalingTiledImageLayer.java

示例7: needsConfigurationFile

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
protected boolean needsConfigurationFile(FileStore fileStore, String fileName, AVList params,
    boolean removeIfExpired)
{
    long expiryTime = this.getExpiryTime();
    if (expiryTime <= 0)
        expiryTime = AVListImpl.getLongValue(params, AVKey.EXPIRY_TIME, 0L);

    return !DataConfigurationUtils.hasDataConfigFile(fileStore, fileName, removeIfExpired, expiryTime);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:10,代码来源:BasicScalingTiledImageLayer.java

示例8: getFileStore

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
protected FileStore getFileStore()
{
	return this.fileStore != null ? this.fileStore : this.layer.getDataFileStore();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:5,代码来源:BasicScalingTiledImageLayer.java

示例9: BulkDownloadPostProcessor

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
public BulkDownloadPostProcessor(TextureTile tile, BasicScalingTiledImageLayer layer, FileStore fileStore)
{
    super(tile, layer, fileStore);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:5,代码来源:BasicScalingTiledImageLayerBulkDownloader.java

示例10: getCacheRoot

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
public static File getCacheRoot() {
    FileStore store = new BasicDataFileStore();
    File cacheRoot = store.getWriteLocation();
    return cacheRoot;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:6,代码来源:CacheUtils.java

示例11: makeLocal

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
/**
 * Start a new {@link BulkRetrievalThread} that downloads all imagery for a given sector and resolution to a
 * specified {@link FileStore}, without downloading imagery that is already in the file store.
 * <p/>
 * This method creates and starts a thread to perform the download. A reference to the thread is returned. To create
 * a downloader that has not been started, construct a {@link BasicTiledImageLayerBulkDownloader}.
 * <p/>
 * Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in
 * meters divided by the globe radius.
 *
 * @param sector     the sector to download data for.
 * @param resolution the target resolution, provided in radians of latitude per texel.
 * @param fileStore  the file store in which to place the downloaded imagery. If null the current World Wind file
 *                   cache is used.
 * @param listener   an optional retrieval listener. May be null.
 *
 * @return the {@link BulkRetrievalThread} executing the retrieval or <code>null</code> if the specified sector does
 *         not intersect the layer bounding sector.
 *
 * @throws IllegalArgumentException if the sector is null or the resolution is less than zero.
 * @see BasicTiledImageLayerBulkDownloader
 */
public BulkRetrievalThread makeLocal(Sector sector, double resolution, FileStore fileStore,
    BulkRetrievalListener listener)
{
    Sector targetSector = sector != null ? getLevels().getSector().intersection(sector) : null;
    if (targetSector == null)
        return null;

    BasicScalingTiledImageLayerBulkDownloader thread = new BasicScalingTiledImageLayerBulkDownloader(this, targetSector,
        resolution, fileStore != null ? fileStore : this.getDataFileStore(), listener);
    thread.setDaemon(true);
    thread.start();
    return thread;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:36,代码来源:BasicScalingTiledImageLayer.java

示例12: getEstimatedMissingDataSize

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
/**
 * Get the estimated size in bytes of the imagery not in a specified file store for a specified sector and
 * resolution.
 * <p/>
 * Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in
 * meters divided by the globe radius.
 *
 * @param sector     the sector to estimate.
 * @param resolution the target resolution, provided in radians of latitude per texel.
 * @param fileStore  the file store to examine. If null the current World Wind file cache is used.
 *
 * @return the estimated size in byte of the missing imagery.
 *
 * @throws IllegalArgumentException if the sector is null or the resolution is less than zero.
 */
public long getEstimatedMissingDataSize(Sector sector, double resolution, FileStore fileStore)
{
    Sector targetSector = sector != null ? getLevels().getSector().intersection(sector) : null;
    if (targetSector == null)
        return 0;

    BasicScalingTiledImageLayerBulkDownloader downloader = new BasicScalingTiledImageLayerBulkDownloader(this, sector, resolution,
        fileStore != null ? fileStore : this.getDataFileStore(), null);

    return downloader.getEstimatedMissingDataSize();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:27,代码来源:BasicScalingTiledImageLayer.java

示例13: BasicScalingTiledImageLayerBulkDownloader

import gov.nasa.worldwind.cache.FileStore; //导入依赖的package包/类
/**
 * Constructs a downloader to retrieve imagery not currently available in a specified file store.
 * <p/>
 * The thread returned is not started during construction, the caller must start the thread.
 *
 * @param layer      the layer for which to download imagery.
 * @param sector     the sector to download data for. This value is final.
 * @param resolution the target resolution, provided in radians of latitude per texel. This value is final.
 * @param fileStore  the file store in which to place the downloaded elevations.
 * @param listener   an optional retrieval listener. May be null.
 *
 * @throws IllegalArgumentException if either the layer, the sector or file store are null, or the resolution is
 *                                  less than zero.
 */
public BasicScalingTiledImageLayerBulkDownloader(BasicScalingTiledImageLayer layer, Sector sector, double resolution,
    FileStore fileStore, BulkRetrievalListener listener)
{
    // Arguments checked in parent constructor
    super(layer, sector, resolution, fileStore, listener);

    this.layer = layer;
    this.level = this.layer.computeLevelForResolution(sector, resolution);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:24,代码来源:BasicScalingTiledImageLayerBulkDownloader.java


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