Package org.apache.commons.vfs2.impl

Examples of org.apache.commons.vfs2.impl.DefaultFileContentInfo


    {
        FileObject file = null;
        try
        {
            file = getReadFolder().resolveFile("file1.txt");
            RandomAccessContent ra = file.getContent().getRandomAccessContent(RandomAccessMode.READ);

            // read first byte
            byte c = ra.readByte();
            assertEquals(c, TEST_DATA.charAt(0));
            assertEquals("fp", ra.getFilePointer(), 1);

            // start at pos 4
            ra.seek(3);
            c = ra.readByte();
            assertEquals(c, TEST_DATA.charAt(3));
            assertEquals("fp", ra.getFilePointer(), 4);

            c = ra.readByte();
            assertEquals(c, TEST_DATA.charAt(4));
            assertEquals("fp", ra.getFilePointer(), 5);

            // restart at pos 4
            ra.seek(3);
            c = ra.readByte();
            assertEquals(c, TEST_DATA.charAt(3));
            assertEquals("fp", ra.getFilePointer(), 4);

            c = ra.readByte();
            assertEquals(c, TEST_DATA.charAt(4));
            assertEquals("fp", ra.getFilePointer(), 5);

            // advance to pos 11
            ra.seek(10);
            c = ra.readByte();
            assertEquals(c, TEST_DATA.charAt(10));
            assertEquals("fp", ra.getFilePointer(), 11);

            c = ra.readByte();
            assertEquals(c, TEST_DATA.charAt(11));
            assertEquals("fp", ra.getFilePointer(), 12);
        }
        finally
        {
            if (file != null)
            {
View Full Code Here


    public FilesCache getFilesCache()
    {
        if (cache == null)
        {
            // cache = new DefaultFilesCache();
            cache = new SoftRefFilesCache();
        }

        return cache;
    }
View Full Code Here

            }
        }

        contentEncoding = httpFile.getHeadMethod().getResponseCharSet();

        return new DefaultFileContentInfo(contentType, contentEncoding);
    }
View Full Code Here

        if (property != null)
        {
            contentEncoding = (String) property.getValue();
        }

        return new DefaultFileContentInfo(contentType, contentEncoding);
    }
View Full Code Here

     *             when a problem occurs creating the FileContentInfo.
     */
    @Override
    public FileContentInfo create(final FileContent fileContent) throws FileSystemException
    {
        return new DefaultFileContentInfo(CONTENT, ENCODING);
    }
View Full Code Here

        if (property != null)
        {
            contentEncoding = (String) property.getValue();
        }

        return new DefaultFileContentInfo(contentType, contentEncoding);
    }
View Full Code Here

            // charset might already be set by the multipart message stuff, else
            // extract it from the contentType now
            charset = contentType.getParameter("charset"); // NON-NLS
        }

        return new DefaultFileContentInfo(
            contentType.getBaseType(),
            charset);
    }
View Full Code Here

            }
        }

        contentEncoding = httpFile.getHeadMethod().getResponseCharSet();

        return new DefaultFileContentInfo(contentType, contentEncoding);
    }
View Full Code Here

            }
        }

        contentEncoding = headMethod.getResponseCharSet();

        return new DefaultFileContentInfo(contentType, contentEncoding);
    }
View Full Code Here

        if (property != null)
        {
            contentEncoding = (String) property.getValue();
        }

        return new DefaultFileContentInfo(contentType, contentEncoding);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs2.impl.DefaultFileContentInfo

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.