protected void doFile ( HttpServletRequest req, HttpServletResponse resp, SmbFile file ) throws IOException { byte[] buf = new byte[8192]; @SuppressWarnings ( "resource" ) ServletOutputStream out = resp.getOutputStream(); String url; int n; try ( SmbFileInputStream in = new SmbFileInputStream(file) ) { url = file.getLocator().getPath(); resp.setContentType("text/plain"); resp.setContentType(URLConnection.guessContentTypeFromName(url)); resp.setHeader("Content-Length", file.length() + ""); resp.setHeader("Accept-Ranges", "Bytes"); while ( ( n = in.read(buf) ) != -1 ) { out.write(buf, 0, n); } } }
protected void doFile ( HttpServletRequest req, HttpServletResponse resp, SmbFile file ) throws IOException { byte[] buf = new byte[8192]; @SuppressWarnings ( "resource" ) ServletOutputStream out = resp.getOutputStream(); String url; int n; try ( SmbFileInputStream in = new SmbFileInputStream(file) ) { url = file.getLocator().getPath(); resp.setContentType("text/plain"); resp.setContentType(URLConnection.guessContentTypeFromName(url)); resp.setHeader("Content-Length", file.length() + ""); resp.setHeader("Accept-Ranges", "Bytes"); while ( ( n = in.read(buf) ) != -1 ) { out.write(buf, 0, n); } } }
out.println("<a class=\"sort\" style=\"width: 180\" href=\"?fmt=detail&sort=date\">Modified</a><br clear='all'><p>"); path = dir.getLocator().getCanonicalURL();
out.println("<a class=\"sort\" style=\"width: 180\" href=\"?fmt=detail&sort=date\">Modified</a><br clear='all'><p>"); path = dir.getLocator().getCanonicalURL();
this.parent = parent; this.nameFilter = filter; SmbResourceLocator locator = parent.getLocator(); this.workgroup = locator.getType() == SmbConstants.TYPE_WORKGROUP; if ( locator.getURL().getHost().isEmpty() ) {
this.parent = parent; this.nameFilter = filter; SmbResourceLocator locator = parent.getLocator(); this.workgroup = locator.getType() == SmbConstants.TYPE_WORKGROUP; if ( locator.getURL().getHost().isEmpty() ) {
if ( this.fileLocator.getShare() == null || dest.getLocator().getShare() == null ) { throw new SmbException("Invalid operation for workgroups or servers"); if ( this.fileLocator.overlaps(dest.getLocator()) ) { throw new SmbException("Source and destination paths overlap.");
if ( this.fileLocator.getShare() == null || dest.getLocator().getShare() == null ) { throw new SmbException("Invalid operation for workgroups or servers"); if ( this.fileLocator.overlaps(dest.getLocator()) ) { throw new SmbException("Source and destination paths overlap.");
String path = dest.getLocator().getUNCPath(); if ( path.length() > 1 ) { try {
String path = dest.getLocator().getUNCPath(); if ( path.length() > 1 ) { try {
searchAttributes = dff.attributes; SmbResourceLocator locator = parent.getLocator(); if ( locator.getURL().getHost().isEmpty() ) {
searchAttributes = dff.attributes; SmbResourceLocator locator = parent.getLocator(); if ( locator.getURL().getHost().isEmpty() ) {