public int getContentLength() { try { connect(); return (int) fo.getSize(); } catch (IOException ex) { return 0; } }
public @Override long getHeaderFieldDate(String name, long Default) { if (name.equalsIgnoreCase("last-modified")) { // NOI18N try { connect(); return fo.lastModified().getTime(); } catch (IOException e) { } } return super.getHeaderFieldDate(name, Default); }
/** Get a header field (currently, content type only). * @param name the header name. Only <code>content-type</code> is guaranteed to be present. * @return the value (i.e., MIME type) */ public String getHeaderField(String name) { if (name.equalsIgnoreCase("content-type")) { // NOI18N try { connect(); if (fo.isFolder()) { return "text/html"; // NOI18N } else { return fo.getMIMEType(); } } catch (IOException e) { } } return super.getHeaderField(name); }
public InputStream getInputStream() throws IOException, UnknownServiceException { connect(); if (iStream == null) { try { if (fo.isFolder()) { iStream = new FIS(fo); } else { iStream = fo.getInputStream(); } } catch (FileNotFoundException e) { ExternalUtil.exception(e); throw e; } } return iStream; }
public OutputStream getOutputStream() throws IOException, UnknownServiceException { connect(); if (fo.isFolder()) { throw new UnknownServiceException(); } if (oStream == null) { FileLock flock = fo.lock(); oStream = new LockOS(fo.getOutputStream(flock), flock); } return oStream; }
public int getContentLength() { try { connect(); return (int)fo.getSize(); } catch (IOException ex) { return 0; } }
public int getContentLength() { try { connect(); return (int)fo.getSize(); } catch (IOException ex) { return 0; } }
/** Get a header field (currently, content type only). * @param name the header name. Only <code>content-type</code> is guaranteed to be present. * @return the value (i.e., MIME type) */ public String getHeaderField(String name) { if (name.equalsIgnoreCase("content-type")) { // NOI18N try { connect(); if (fo.isFolder()) return "text/html"; // NOI18N else return fo.getMIMEType (); } catch (IOException e) { } } return super.getHeaderField(name); }
/** Get a header field (currently, content type only). * @param name the header name. Only <code>content-type</code> is guaranteed to be present. * @return the value (i.e., MIME type) */ public String getHeaderField(String name) { if (name.equalsIgnoreCase("content-type")) { // NOI18N try { connect(); if (fo.isFolder()) return "text/html"; // NOI18N else return fo.getMIMEType (); } catch (IOException e) { } } return super.getHeaderField(name); }
public InputStream getInputStream() throws IOException, UnknownServiceException { connect (); if (iStream == null) { try { if (fo.isFolder()) { iStream = new FIS (fo); } else { iStream = fo.getInputStream(); } } catch (FileNotFoundException e) { ExternalUtil.exception (e); throw e; } } return iStream; }
public InputStream getInputStream() throws IOException, UnknownServiceException { connect (); if (iStream == null) { try { if (fo.isFolder()) { iStream = new FIS (fo); } else { iStream = fo.getInputStream(); } } catch (FileNotFoundException e) { ExternalUtil.exception (e); throw e; } } return iStream; }
public OutputStream getOutputStream() throws IOException, UnknownServiceException { connect(); if (fo.isFolder()) throw new UnknownServiceException(); if (oStream == null) { FileLock flock = fo.lock(); oStream = new LockOS (fo.getOutputStream(flock), flock); } return oStream; }
public OutputStream getOutputStream() throws IOException, UnknownServiceException { connect(); if (fo.isFolder()) throw new UnknownServiceException(); if (oStream == null) { FileLock flock = fo.lock(); oStream = new LockOS (fo.getOutputStream(flock), flock); } return oStream; }