本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
}
}
示例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);
}
}
示例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;
}
}
}
示例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;
}
}