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


Java VfsLog类代码示例

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


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

示例1: doCloseCommunicationLink

import org.apache.commons.vfs2.VfsLog; //导入依赖的package包/类
@Override
protected void doCloseCommunicationLink()
{
    // Release the zip file
    try
    {
        if (zipFile != null)
        {
            zipFile.close();
            zipFile = null;
        }
    }
    catch (final IOException e)
    {
        // getLogger().warn("vfs.provider.zip/close-zip-file.error :" + file, e);
        VfsLog.warn(getLogger(), LOG, "vfs.provider.zip/close-zip-file.error :" + file, e);
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:19,代码来源:ZipFileSystem.java

示例2: closeConnection

import org.apache.commons.vfs2.VfsLog; //导入依赖的package包/类
/**
 * Cleans up the connection to the server.
 * @param client The FtpClient.
 */
private void closeConnection(final FtpClient client)
{
    try
    {
        // Clean up
        if (client.isConnected())
        {
            client.disconnect();
        }
    }
    catch (final IOException e)
    {
        // getLogger().warn("vfs.provider.ftp/close-connection.error", e);
        VfsLog.warn(getLogger(), LOG, "vfs.provider.ftp/close-connection.error", e);
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:21,代码来源:FtpFileSystem.java

示例3: doCloseCommunicationLink

import org.apache.commons.vfs2.VfsLog; //导入依赖的package包/类
@Override
protected void doCloseCommunicationLink()
{
    // Release the tar file
    try
    {
        if (tarFile != null)
        {
            tarFile.close();
            tarFile = null;
        }
    }
    catch (final IOException e)
    {
        // getLogger().warn("vfs.provider.tar/close-tar-file.error :" + file, e);
        VfsLog.warn(getLogger(), LOG, "vfs.provider.tar/close-tar-file.error :" + file, e);
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:19,代码来源:TarFileSystem.java

示例4: init

import org.apache.commons.vfs2.VfsLog; //导入依赖的package包/类
/**
 * Initialises this component.
 * @throws FileSystemException if an error occurs.
 */
@Override
public void init() throws FileSystemException
{
    if (tempDir == null)
    {
        String baseTmpDir = System.getProperty("java.io.tmpdir");

        tempDir = new File(baseTmpDir, "vfs_cache").getAbsoluteFile();
    }

    filecount = new Random().nextInt() & MASK;

    if (!tempDirMessageLogged)
    {
        final String message = Messages.getString("vfs.impl/temp-dir.info", tempDir);
        VfsLog.info(getLogger(), log, message);

        tempDirMessageLogged = true;
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:25,代码来源:DefaultFileReplicator.java

示例5: fireEvent

import org.apache.commons.vfs2.VfsLog; //导入依赖的package包/类
/**
 * Fires an event.
 */
private void fireEvent(final AbstractFileChangeEvent event)
{
    FileListener[] fileListeners = null;
    final FileObject file = event.getFile();

    synchronized (listenerMap)
    {
        final ArrayList<?> listeners = listenerMap.get(file.getName());
        if (listeners != null)
        {
            fileListeners = listeners.toArray(new FileListener[listeners.size()]);
        }
    }

    if (fileListeners != null)
    {
        for (int i = 0; i < fileListeners.length; i++)
        {
            final FileListener fileListener = fileListeners[i];
            try
            {
                event.notify(fileListener);
            }
            catch (final Exception e)
            {
                final String message = Messages.getString("vfs.provider/notify-listener.warn", file);
                // getLogger().warn(message, e);
                VfsLog.warn(getLogger(), LOG, message, e);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:36,代码来源:AbstractFileSystem.java

示例6: deleteFile

import org.apache.commons.vfs2.VfsLog; //导入依赖的package包/类
/**
 * physically deletes the file from the filesystem
 * @param file The File to delete.
 */
protected void deleteFile(File file)
{
    try
    {
        final FileObject fileObject = getContext().toFileObject(file);
        fileObject.delete(Selectors.SELECT_ALL);
    }
    catch (final FileSystemException e)
    {
        final String message = Messages.getString("vfs.impl/delete-temp.warn", file.getName());
        VfsLog.warn(getLogger(), log, message, e);
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:18,代码来源:DefaultFileReplicator.java

示例7: run

import org.apache.commons.vfs2.VfsLog; //导入依赖的package包/类
@Override
public void run()
{
    loop: while (!requestEnd && !Thread.currentThread().isInterrupted())
    {
        try
        {
            Reference<?> ref = refqueue.remove(TIMEOUT);
            if (ref == null)
            {
                continue;
            }

            lock.lock();
            try
            {
                FileSystemAndNameKey key = refReverseMap.get(ref);

                if (key != null)
                {
                    if (removeFile(key))
                    {
                        filesystemClose(key.getFileSystem());
                    }
                }
            }
            finally
            {
                lock.unlock();
            }
        }
        catch (InterruptedException e)
        {
            if (!requestEnd)
            {
                VfsLog.warn(getLogger(), log,
                            Messages.getString("vfs.impl/SoftRefReleaseThread-interrupt.info"));
            }
            break loop;
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:43,代码来源:SoftRefFilesCache.java

示例8: removeLRU

import org.apache.commons.vfs2.VfsLog; //导入依赖的package包/类
@Override
protected boolean removeLRU(final AbstractLinkedMap.LinkEntry linkEntry)
{
    synchronized (LRUFilesCache.this)
    {
        FileObject file = (FileObject) linkEntry.getValue();

        // System.err.println(">>> " + size() + " check removeLRU:" + linkEntry.getKey().toString());

        if (file.isAttached() || file.isContentOpen())
        {
            // do not allow open or attached files to be removed
            // System.err.println(">>> " + size() + " VETO removeLRU:" +
            //    linkEntry.getKey().toString() + " (" + file.isAttached() + "/" +
            //    file.isContentOpen() + ")");
            return false;
        }

        // System.err.println(">>> " + size() + " removeLRU:" + linkEntry.getKey().toString());
        if (super.removeLRU(linkEntry))
        {
            try
            {
                // force detach
                file.close();
            }
            catch (FileSystemException e)
            {
                VfsLog.warn(getLogger(), log, Messages.getString("vfs.impl/LRUFilesCache-remove-ex.warn"), e);
            }

            Map<?, ?> files = filesystemCache.get(filesystem);
            if (files.size() < 1)
            {
                filesystemCache.remove(filesystem);
            }

            return true;
        }

        return false;
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:44,代码来源:LRUFilesCache.java


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