Apache VFS (6): several important conceptual Interfaces

Source: Internet
Author: User
This series Article Navigation

Apache VFS (1): Basic Introduction

Apache VFS (2): file monitoring and monitoring

Apache VFS (3): file filter and Selector

Apache VFS (4): Events

Apache VFS (5): use it!

Apache VFS (6): several important conceptual Interfaces

Apache VFS (7): File Manager File Parsing Method

It is very important to understand the conceptual interfaces of Apache VFS, because there are too few examples of Apache VFS. If you do not study them carefully, it is not clear to them:

Vfscomponent Interface

This interface is called to manage the lifecycle of all VFS components. The method is relatively simple:

    1. Init is used to initialize components.
    2. Close is used to close components.
    3. Setcontext (vfscomponentcontext CTX) settingsComponent Context

      , Note that it maintainsComponent context: vfscomponentcontext

    4. Setlogger

An abstract class implements this interface.Abstractvfscomponent

Abstract class. This abstract class adds the getcontext () method to obtain the component context. The abstractvfscomponent abstract class is very important. There are several important classes that inherit it:

    1. Abstractfilescache
    2. Abstractfilesystem
    3. Abstractvfscontainer
    4. Defaultfilereplicator

Vfscomponentcontext Interface

This interface allows VFS components to access the services they need, such
Filereplicator Interface

The task of this interface is to create a local copy of the file. Only one methodReplicatefile (fileobject SRC, fileselector SEL)

, Returns a file object. There are two classes to implement this interface:

    1. Defaultfilereplicator is a simple file replicaset and temporary file warehouse. It also implements the filereplicator interface, temporaryfilestore interface, and vfscomponent interface.
    2. Priviledgedfilereplicator is the packaging class of a file replicaset that accepts a file replicaset as a parameter. This packaging class can execute certain actions that require Permissions

Temporaryfilestore Interface

This interface is used to manage the local temporary file warehouse. There is only one implementation class, that is, the defaultfilereplicator class. There is only one method
Allocatefile (string basename)
Accepts a string and returns a file object. This method will allocate a temporary file. When the Warehouse is closed, the temporary file and all the sub-files will be deleted.

Fileprovider Interface

Each fileprovider file provider is responsible for processing special types of Uri modes, such as FTP and HTTP.

 

Source: http://alartin.javaeye.com/blog/92412

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.