public int getContentLength() { try { return (int) content.getSize(); } catch (FileSystemException fse) { } return -1; }
public int getContentLength() { try { return (int) content.getSize(); } catch (FileSystemException fse) { } return -1; }
public long length() throws IOException { return fileObject.getContent().getSize(); } }
/** * Returns the size of the file content (in bytes). Is only called if * {@link #doGetType} returns {@link FileType#FILE}. */ protected long doGetContentSize() throws Exception { return file.getContent().getSize(); }
public long length() throws IOException { return fileObject.getContent().getSize(); } }
public long length() throws IOException { return fileObject.getContent().getSize(); } }
/** * Returns the content of a file, as a byte array. * * @param file The file to get the content of. */ public static byte[] getContent(final FileObject file) throws IOException { final FileContent content = file.getContent(); final int size = (int) content.getSize(); final byte[] buf = new byte[size]; final InputStream in = content.getInputStream(); try { int read = 0; for (int pos = 0; pos < size && read >= 0; pos += read) { read = in.read(buf, pos, size - pos); } } finally { in.close(); } return buf; }
/** * Returns the size of the file content (in bytes). */ protected long doGetContentSize() throws Exception { if (this.fileInfo.isSymbolicLink()) { return getLinkDestination().getContent().getSize(); } else { return this.fileInfo.getSize(); } }
public static UnixFsObject.RegularFile fromFileObject( RelativePath toFile, FileObject fromFile, FileAttributes attributes ) throws FileSystemException { FileContent content = fromFile.getContent(); LocalDateTime time = new LocalDateTime( content.getLastModifiedTime() ); return regularFile( toFile, time, content.getSize(), fromNull( attributes ) ); }
private void init() { if (!init) { try { resourceImpl = fsManager.resolveFile(vfsURI); content = resourceImpl.getContent(); exists = resourceImpl.exists(); lastModified = content.getLastModifiedTime(); contentLength = content.getSize(); } catch (FileSystemException e) { Message.debug(e); Message.verbose(e.getLocalizedMessage()); exists = false; lastModified = 0; contentLength = 0; } init = true; } }
log(newPrefix + "Content-Length: " + content.getSize()); log(newPrefix + "Last-Modified" + new Date(content.getLastModifiedTime())); if (showContent)
if ( fileObjects[i].getType().equals( FileType.FILE ) ) file.setSize( fileObjects[i].getContent().getSize() );
setContentLength(m_fileContent.getSize()); } catch (final FileSystemException e) {
io.info("Size: {} bytes", content.getSize());
io.info("Size: {} bytes", content.getSize());