Examples of FileSystem


Examples of org.apache.jackrabbit.core.fs.FileSystem

    protected InternalVersionManagerImpl createVersionManager(VersioningConfig vConfig,
                                                      DelegatingObservationDispatcher delegatingDispatcher)
            throws RepositoryException {


        FileSystem fs = vConfig.getFileSystem();
        PersistenceManager pm = createPersistenceManager(vConfig.getHomeDir(),
                fs,
                vConfig.getPersistenceManagerConfig(),
                rootNodeId,
                nsReg,
View Full Code Here

Examples of org.apache.james.filesystem.api.FileSystem

     * @return the user repository
     * @throws Exception
     */
    @Override
    protected UsersRepository getUsersRepository() throws Exception {
        FileSystem fs = new FileSystem() {

            @Override
            public File getBasedir() throws FileNotFoundException {
                return new File(".");
            }
View Full Code Here

Examples of org.apache.james.services.FileSystem

     */
    protected UsersRepository getUsersRepository() throws Exception {
       
        UsersFileRepository res = new UsersFileRepository();

        FileSystem fs = new FileSystem() {

            public File getBasedir() throws FileNotFoundException {
                return new File(".");
            }

View Full Code Here

Examples of org.apache.olio.webapp.util.fs.FileSystem

        // set proper contentType
        String mimeType = context.getMimeType(pathInfo);
        response.setContentType(mimeType);

        // Modified for DFS support
        FileSystem fs = ServiceLocator.getInstance().getFileSystem();
        /*
         * Shanti: Do not try and get image path here. Delegate to filesystem
        // look for file in default location such as WEB-INF
        String imagePath = WebappUtil.getArtifactLocalionDir() + pathInfo;
         */
        // Strip leading slash from pathInfo
        String imagePath;
        if (pathInfo.charAt(0) == '/')
            imagePath = pathInfo.substring(1);
        else
            imagePath = pathInfo;

        logger.finer("Image path = " + imagePath);
        File imageFile = new File(imagePath);

        /* Assume image exists -- This was done to reduce FileSystem interaction
        if(!fs.exists(imagePath)) {
        System.out.println ("Could not find file - " + imagePath);
        // not in default location, look in upload location
        imageFile=new File(context.getRealPath("artifacts/" + pathInfo));
        if (!fs.exists(imageFile.getCanonicalPath())) {
        WebappUtil.getLogger().log(Level.SEVERE, "image_does_not_exist", imageFile.getCanonicalPath());
        return null;
        }
        }
         ** End mod */

        FileInputStream fis = null;
        FileChannel in = null;
        WritableByteChannel out = null;

        // serve up image from proper location
        // Use local file system if the image is in default location.
        logger.finer("AcessArtifact -- imagePath = " + imagePath);
        InputStream is = null;
        try {
            is = fs.open(imagePath);
        } catch (FileNotFoundException nfe) {
            logger.severe("File not found - imagePath = " + imagePath);
        } catch (IOException ioe) {
            logger.severe("IOException - imagePath = " + imagePath);
        }
        if (is == null) {
            logger.severe("Could not open image: " + imagePath);
        } else {
            if (is instanceof FileInputStream) {
                logger.finer("Streaming from file --");
                try {
                    // NIO transferTo takes the slow route since we are passing along a wrapped
                    // buffer rather than the Socket output stream.
                    // From experiments we did, it looks like
                    // Using traditional I/O is more efficient than using NIO in our case - for
                    // small files.
                    /*
                    fis = (FileInputStream) (is);
                    in = fis.getChannel();
                    out = Channels.newChannel(response.getOutputStream());
                    in.transferTo(0, in.size(), out);
                     * */
                    byte[] buf = tlBuf.get();
                    int count;
                    while ((count = is.read(buf)) != -1) {
                        response.getOutputStream().write(buf, 0, count);
                    }
                } finally {
                    WebappUtil.closeIgnoringException(in);
                    WebappUtil.closeIgnoringException(fis);
                    WebappUtil.closeIgnoringException(out);
                }
            } else {
                if (bDebug) {
                    System.out.println("Not a FileInputStream");
                }
                InputStream iStream = null;
                try {
                    OutputStream oStream = response.getOutputStream();
                    iStream = fs.open(imageFile.getCanonicalPath());
                    // With the current implementation, we only support FS, so this is a plcae holder.
                    // TODO - Optimize this (if required) when DFS is supported
                    byte[] buffer = new byte[4096];
                    int len;
                    while ((len = iStream.read(buffer)) != -1) {
View Full Code Here

Examples of org.apache.tapestry.workbench.tree.examples.fsmodel.FileSystem

        System.out.println("strRootDir = " + strRootDir);

        if (strRootDir == null || "".equals(strRootDir))
        {
            objParent = new FileSystem();
        }
        else
        {
            FolderObject objFolder = new FolderObject(null, new File(strRootDir), true);
            objFolder.reload();
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem

    // element of the classpath is likely to be a directory. If we ensure every element of the array is set to
    // only look for BINARY, then we make sure that for any classpath element that is a directory, we won't build
    // a classpathDirectory object that will attempt to look for source when it can't find binary.
    // int[] classpathModes = new int[classpaths.length];
    // for (int i =0 ;i<classpaths.length;i++) classpathModes[i]=ClasspathDirectory.BINARY;
    return new FileSystem(classpaths, filenames, defaultEncoding, ClasspathLocation.BINARY);
  }
View Full Code Here

Examples of org.drools.compiler.compiler.io.FileSystem

import org.junit.Test;

public class MemoryFileTest {
    @Test
    public void testFileCreation() throws IOException {
        FileSystem fs = new MemoryFileSystem();
       
        Folder mres = fs.getFolder( "src/main/java/org/domain" )
       
        File f1 = mres.getFile( "MyClass.java" );
        f1.create( new ByteArrayInputStream( "ABC".getBytes() ) );
       
        mres.create();
View Full Code Here

Examples of org.eclipse.core.filesystem.provider.FileSystem

      Policy.error(EFS.ERROR_INTERNAL, NLS.bind(Messages.noFileSystem, scheme));
    if (result instanceof IFileSystem)
      return (IFileSystem) result;
    try {
      IConfigurationElement element = (IConfigurationElement) result;
      FileSystem fs = (FileSystem) element.createExecutableExtension("run"); //$NON-NLS-1$
      fs.initialize(scheme);
      //store the file system instance so we don't have to keep recreating it
      registry.put(scheme, fs);
      return fs;
    } catch (CoreException e) {
      //remove this invalid file system from the registry
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.batch.FileSystem

            CompilerOptions options,
            @NonNull List<ICompilationUnit> sourceUnits,
            @NonNull List<String> classPath,
            @NonNull Map<ICompilationUnit, CompilationUnitDeclaration> outputMap,
            @Nullable LintClient client) {
        INameEnvironment environment = new FileSystem(
                classPath.toArray(new String[classPath.size()]), new String[0],
                options.defaultEncoding);
        IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
        IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
        ICompilerRequestor requestor = new ICompilerRequestor() {
View Full Code Here

Examples of org.gradle.internal.nativeplatform.filesystem.FileSystem

    }

    @TaskAction
    protected void copy() {
        Instantiator instantiator = getInstantiator();
        FileSystem fileSystem = getFileSystem();

        CopyActionExecuter copyActionExecuter = new CopyActionExecuter(instantiator, fileSystem);
        CopyAction copyAction = createCopyAction();
        WorkResult didWork = copyActionExecuter.execute(rootSpec, copyAction);
        setDidWork(didWork.getDidWork());
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.