Examples of FileContext

While URI names are very flexible, it requires knowing the name or address of the server. For convenience one often wants to access the default system in one's environment without knowing its name/address. This has an additional benefit that it allows one to change one's default fs (e.g. admin moves application from cluster1 to cluster2).

To facilitate this, Hadoop supports a notion of a default file system. The user can set his default file system, although this is typically set up for you in your environment via your default config. A default file system implies a default scheme and authority; slash-relative names (such as /for/bar) are resolved relative to that default FS. Similarly a user can also have working-directory-relative names (i.e. names not starting with a slash). While the working directory is generally in the same default FS, the wd can be in a different FS.

Hence Hadoop path names can be one of:

Relative paths with scheme (scheme:foo/bar) are illegal.

****The Role of the FileContext and configuration defaults****

The FileContext provides file namespace context for resolving file names; it also contains the umask for permissions, In that sense it is like the per-process file-related state in Unix system. These two properties

in general, are obtained from the default configuration file in your environment, (@see {@link Configuration}). No other configuration parameters are obtained from the default config as far as the file context layer is concerned. All file system instances (i.e. deployments of file systems) have default properties; we call these server side (SS) defaults. Operation like create allow one to select many properties: either pass them in as explicit parameters or use the SS properties.

The file system related SS defaults are

*** Usage Model for the FileContext class ***

Example 1: use the default config read from the $HADOOP_CONFIG/core.xml. Unspecified values come from core-defaults.xml in the release jar.

Example 2: Get a FileContext with a specific URI as the default FS Example 3: FileContext with local file system as the default Example 4: Use a specific config, ignoring $HADOOP_CONFIG Generally you should not need use a config unless you are doing
  • org.eclipse.php.internal.core.typeinference.context.FileContext
    This is a context for PHP file (outside of classes or functions) @author michael
  • org.simpleframework.http.resource.FileContext
    The FileContext provides an implementation of the Context object that provides a direct mapping from a request URI as defined in RFC 2616 to an OS specific target. This uses a File object to define the mapping for the request URI paths. Using a File object allows the FileContext to be easily used with both DOS and UNIX systems.

    This Indexer implementation uses an MIME database to obtain mappings for the getContentType method. The file used is acquired from the class path as a mapping from file extension to MIME type. This file can be modified if any additional types are required. However it is more advisable to simple extend this object and override the content type method. @author Niall Gallagher @see org.simpleframework.http.resource.FileIndexer

  • org.uengine.contexts.FileContext
    @author Jinyoung Jang
  • simple.http.serve.FileContext

  • Examples of org.eclipse.php.internal.core.typeinference.context.FileContext

              namespace = null;
            }
          }
          String fullName = AbstractOccurrencesFinder.getFullName(identifier,
              fLastUseParts, namespace);
          FileContext context = new FileContext(getSourceModule(),
              SourceParserUtil.getModuleDeclaration(getSourceModule(),
                  null), identifier.getStart());

          IModelElement[] elements = PHPTypeInferenceUtils.getModelElements(
              PHPClassType.fromTypeName(fullName, getSourceModule(),
    View Full Code Here

    Examples of org.simpleframework.http.resource.FileContext

    import java.net.InetSocketAddress;

    public class SimpleHttpFileServerFactory implements HttpFileServerFactory {

        public HttpFileServer start(File contentRoot, int port) {
            Container container = new SimpleFileServerContainer(new FileContext(contentRoot));

            try {
                final Server server = new ContainerServer(container);
                Connection connection = new SocketConnection(server);
                InetSocketAddress address = new InetSocketAddress(port);
    View Full Code Here

    Examples of org.uengine.contexts.FileContext

            beanId = null;
        }
       
        public int doStartTag() throws JspException {
            try {
              FileContext fc = null;
                JspWriter out = pageContext.getOut();
                Object[] beanValues = HttpUtils.getParameterAsObject(beanId, name, dVal, viewmode, pageContext); //mapping values
         
                if (beanValues[0] instanceof FileContext) {
                  fc = (FileContext) beanValues[0];
    View Full Code Here

    Examples of simple.http.serve.FileContext

          }
         
          // Create the simpleweb connection if nessesary
          if (mSimplewebConnection == null) {
            try {
              FileContext context = new FileContext(new File("web"));
              MapperEngine engine = new MapperEngine(context);
             
              engine.load("SharedTagService", SharedTagService.class.getName());
              engine.link("*", "SharedTagService");
             
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.