Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileName


                                                  final boolean cellHasFocus)
    {
      if (value instanceof WebSolutionFileObject)
      {
        final WebSolutionFileObject fo = (WebSolutionFileObject) value;
        final FileName fileName = fo.getName();
        try
        {
          return super.getListCellRendererComponent(list, fileName.getPathDecoded(), index, isSelected, cellHasFocus);
        }
        catch (FileSystemException e)
        {
          // ignored ..
        }
View Full Code Here


                    String childname = child.getFileName();
                    if (childname != null && //!".".equals(childname) && !"..".equals(childname) &&
                            !"./".equals(childname) && !"../".equals(childname)) {

                        // update the child FileObjects MslxEntry
                        FileName fn = null;
                        try {
                            // Resolves a name, relative to the "root" file name.
                            // Refer to NameScope  for a description of how names are resolved.
                            //
                            // Parameters:
                            // root - the base filename (which is'this' GridFtpMlsxFileObject which is the parent)
                            // name - The name to resolve.
                            // scope - The NameScope to use when resolving the name.
                            fn = getFileSystem().getFileSystemManager().
                                resolveName(getName(), UriParser.encode(childname), NameScope.CHILD);
                        }catch(Exception ex){
                            // VFS didn't like the child name for whatever reason,
                            // (prob an illegal file name char?).
                            // Therefore, don't bother adding it as a child as
                            // VFS will trip over if trying to resolve the child FileObject.
                            log.error("Skipping unresolvable child FileObject");
                        }
                        // Need to check that childname == fn.getBaseName()
                        // otherwise, will not be able to resolveFile correctly which causes ex.
                        if (fn != null && childname != null && childname.equals(fn.getBaseName())) {

                            GridFtpMlsxFileObject fo = (GridFtpMlsxFileObject) getFileSystem().resolveFile(fn);
                            //fo.file = client.mlst(childname);
                            fo.file = child;
View Full Code Here

                    String childname = child.getFileName();
                    if (childname != null && //!".".equals(childname) && !"..".equals(childname) &&
                            !"./".equals(childname) && !"../".equals(childname)) {

                        // update the child FileObjects MslxEntry
                        FileName fn = null;
                        try {
                            // Resolves a name, relative to the "root" file name.
                            // Refer to NameScope  for a description of how names are resolved.
                            //
                            // Parameters:
                            // root - the base filename (which is'this' GridFtpMlsxFileObject which is the parent)
                            // name - The name to resolve.
                            // scope - The NameScope to use when resolving the name.
                            fn = getFileSystem().getFileSystemManager().
                                resolveName(getName(), UriParser.encode(childname), NameScope.CHILD);
                        }catch(Exception ex){
                            // VFS didn't like the child name for whatever reason,
                            // (prob an illegal file name char?).
                            // Therefore, don't bother adding it as a child as
                            // VFS will trip over if trying to resolve the child FileObject.
                            log.warn("Skipping unresolvable child FileObject: childname = " + childname);
                        }
                        // Need to check that childname == fn.getBaseName()
                        // otherwise, will not be able to resolveFile correctly which causes ex.
                        if (fn != null && childname != null && childname.equals(fn.getBaseName())) {

                            GridFtpMlsxFileObject fo = (GridFtpMlsxFileObject) getFileSystem().resolveFile(fn);
                            //fo.file = client.mlst(childname);
                            fo.file = child;
View Full Code Here

                    String childname = child.getFileName();
                    if (childname != null && //!".".equals(childname) && !"..".equals(childname) &&
                            !"./".equals(childname) && !"../".equals(childname)) {

                        // update the child FileObjects MslxEntry
                        FileName fn = null;
                        try {
                            // Resolves a name, relative to the "root" file name.
                            // Refer to NameScope  for a description of how names are resolved.
                            //
                            // Parameters:
                            // root - the base filename (which is'this' GridFtpMlsxFileObject which is the parent)
                            // name - The name to resolve.
                            // scope - The NameScope to use when resolving the name.
                            fn = getFileSystem().getFileSystemManager().
                                resolveName(getName(), UriParser.encode(childname), NameScope.CHILD);
                        }catch(Exception ex){
                            // VFS didn't like the child name for whatever reason,
                            // (prob an illegal file name char?).
                            // Therefore, don't bother adding it as a child as
                            // VFS will trip over if trying to resolve the child FileObject.
                            log.error("Skipping unresolvable child FileObject");
                        }
                        // Need to check that childname == fn.getBaseName()
                        // otherwise, will not be able to resolveFile correctly which causes ex.
                        if (fn != null && childname != null && childname.equals(fn.getBaseName())) {

                            GridFtpMlsxFileObject fo = (GridFtpMlsxFileObject) getFileSystem().resolveFile(fn);
                            //fo.file = client.mlst(childname);
                            fo.file = child;
View Full Code Here

                        // root - the base filename
                        // name - The name to resolve.
                        // scope - The NameScope to use when resolving the name.

                        // update the child FileObjects GeneralFile.
                        FileName fn = getFileSystem().getFileSystemManager().
                                resolveName(getName(), UriParser.encode(childname), NameScope.CHILD);
                        //log.debug("childname: [" + childname + "] fnStr: [" + fn.toString() + "] fnBas: [" + fn.getBaseName() + "]");

                        /**
                         * VFS resolveName and Jargon GeneralFile.getName() bug.
                         * Refer to results of following debug statement in explanation:
                         * log.debug("childname: [" + childname + "] fnStr: [" + fn.toString() + "] fnBas: [" + fn.getBaseName() + "]");
                         *
                         * A) Output of SRB Sls:
                         * =====================
                         * [ngs0153@ngs ~]$ Sls /ngs/home
                         *    C-/ngs/home/http://marc.theaimsgroup.com/?l=redhat-list&m=109219329520329&w=2.ngs
                         *    C-/home/ngs/david-meredith.ngs
                         *    ...
                         * Note, that the file listing above contains a collection whose name
                         * begins with a url "http;//marc.theaimsgroup.com.."
                         *                       
                         *
                         * B) Name retireved by Jargon (child.getName()):
                         * ==============================================
                         *    childname: [?l=redhat-list&m=109219329520329&w=2.ngs]
                         *   
                         * Note, that the child name does not include the url
                         * part of the file name ("http;//marc.theaimsgroup.com..").
                         *
                         *                       
                         * D) FileName resolved by VFS (fn above)
                         * ========================================
                         *    fnStr:     [srb://srb1.ngs.rl.ac.uk/ngs/home?l=redhat-list&m=109219329520329&w=2.ngs]
                         *    fnBas:     [home]
                         *
                         * Note that the fn.toString() does not include the url part of the file name and also drops the
                         * file separator betweeen the home dir and the file name ("/ngs/home?l=redhat...").
                         * As a result, the fn.getBaseName() returns 'home' which is wrong.
                         */
                        // Due to above bug, need to check that childname == fn.getBaseName()
                        // otherwise, will not be able to resolveFile correctly which causes ex.
                        if (fn != null && childname != null && childname.equals(fn.getBaseName())) {
                            //&& !"srb://srb1.ngs.rl.ac.uk/ngs/home?l=redhat-list&m=109219329520329&w=2.ngs".equals(fn.toString())) {

                            SrbGeneralFileFileObject fo = (SrbGeneralFileFileObject) getFileSystem().resolveFile(fn);
                            // Could also pass string to resolveFile and this must be an absPath !
                            //SrbGeneralFileFileObject fo = (SrbGeneralFileFileObject) getFileSystem().resolveFile(getName().getPath() + getName().SEPARATOR + childname);
View Full Code Here

                    String childname = child.getFileName();
                    if (childname != null && //!".".equals(childname) && !"..".equals(childname) &&
                            !"./".equals(childname) && !"../".equals(childname)) {

                       // update the child FileObjects MslxEntry
                        FileName fn = null;
                        try {
                            // Resolves a name, relative to the "root" file name.
                            // Refer to NameScope  for a description of how names are resolved.
                            //
                            // Parameters:
                            // root - the base filename (which is'this' GridFtpMlsxFileObject which is the parent)
                            // name - The name to resolve.
                            // scope - The NameScope to use when resolving the name.
                            fn = getFileSystem().getFileSystemManager().
                                resolveName(getName(), UriParser.encode(childname), NameScope.CHILD);
                        }catch(Exception ex){
                            // VFS didn't like the child name for whatever reason,
                            // (prob an illegal file name char?).
                            // Therefore, don't bother adding it as a child as
                            // VFS will trip over if trying to resolve the child FileObject.
                            log.error("Skipping unresolvable child FileObject");
                        }
                        // Need to check that childname == fn.getBaseName()
                        // otherwise, will not be able to resolveFile correctly which causes ex.
                        if (fn != null && childname != null && childname.equals(fn.getBaseName())) {

                            GridFtpMlsxFileObject fo = (GridFtpMlsxFileObject) getFileSystem().resolveFile(fn);
                            //fo.file = client.mlst(childname);
                            fo.file = child;
View Full Code Here

                                                  final boolean cellHasFocus)
    {
      if (value instanceof WebSolutionFileObject)
      {
        final WebSolutionFileObject fo = (WebSolutionFileObject) value;
        final FileName fileName = fo.getName();
        try
        {
          return super.getListCellRendererComponent(list, fileName.getPathDecoded(), index, isSelected, cellHasFocus);
        }
        catch (FileSystemException e)
        {
          // ignored ..
        }
View Full Code Here

            final String key = this.getClass().getName() + rootUrl.toString();
            FileSystem fs = findFileSystem(key, fileSystemOptions);
            if (fs == null)
            {
                String extForm = rootUrl.toExternalForm();
                final FileName rootName = getContext().parseURI(extForm);
                // final FileName rootName =
                //    new BasicFileName(rootUrl, FileName.ROOT_PATH);
                fs = new MvnFileSystem(rootName, fileSystemOptions);
                addFileSystem(key, fs);
            }
View Full Code Here

    super("repo", fileRef, fileType);
  }

  @NotNull
  public FileName createName(String s, FileType fileType) {
    FileName name = new RepositoryFileName(s, fileType);
    return name;
  }
View Full Code Here

  }

  @Override
  public FileName createName( final String absPath, final FileType fileType ) {

    FileName name = new SolutionRepositoryFileName( absPath, fileType );
    return name;
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs.FileName

Copyright © 2018 www.massapicom. 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.