jcifs-1.2.13 from tgz
authorFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:41:59 +0000 (16:41 +0200)
committerFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:41:59 +0000 (16:41 +0200)
Mon Jan 22 15:26:01 EST 2007
jcifs-1.2.13 released.

A new SmbFile.getShareSecurity() method that uses a new
MsrpcShareGetInfo/ShareInfo502 RPC has been added. This will return the
ACL for a share as opposed to the ACL for the directory shared. See the
API documentation for details. Several DFS issues have been identified
and fixed. If JCIFS receives a NoRouteToHostException on port 445 it
will now try to fallback to port 139. This code has been tested fairly
well already. There have been no changes since b4.

README.txt
build.xml
patches/Print.patch [new file with mode: 0644]
patches/README.txt

index bba3e4f..0f9fb33 100644 (file)
@@ -1,3 +1,14 @@
+Mon Jan 22 15:26:01 EST 2007
+jcifs-1.2.13 released.
+
+A new SmbFile.getShareSecurity() method that uses a new
+MsrpcShareGetInfo/ShareInfo502 RPC has been added. This will return the
+ACL for a share as opposed to the ACL for the directory shared. See the
+API documentation for details. Several DFS issues have been identified
+and fixed. If JCIFS receives a NoRouteToHostException on port 445 it
+will now try to fallback to port 139. This code has been tested fairly
+well already. There have been no changes since b4.
+
 Mon Jan 15 15:47:47 EST 2007
 jcifs-1.2.13b4 released
 
index 8f8ccac..7a65afe 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,7 @@
 <project name="jcifs" default="usage" basedir=".">
 
-    <property name="version" value="1.2.13b4"/>
-    <property name="reldate" value="Jan 15, 2007"/>
+    <property name="version" value="1.2.13"/>
+    <property name="reldate" value="Jan 22, 2007"/>
 
     <target name="usage">
         <echo>
diff --git a/patches/Print.patch b/patches/Print.patch
new file mode 100644 (file)
index 0000000..7a221f5
--- /dev/null
@@ -0,0 +1,115 @@
+diff -Nuar old-src/jcifs/smb/SmbTree.java src/jcifs/smb/SmbTree.java
+--- old-src/jcifs/smb/SmbTree.java  2007-01-16 06:00:31.231245500 -0500
++++ src/jcifs/smb/SmbTree.java  2007-01-16 05:55:40.148493000 -0500
+@@ -90,6 +90,8 @@
+                             throw new SmbException( "Invalid operation for " + service + " service" );
+                     }
+                     break;
++                case ServerMessageBlock.SMB_COM_WRITE:
++                    if (service.equals("LPT1:")) break;
+                 default:
+                     throw new SmbException( "Invalid operation for " + service + " service" + request );
+             }
+diff -Nuar old-examples/PrintHtml.java examples/PrintHtml.java
+--- old-examples/PrintHtml.java 1969-12-31 19:00:00.000000000 -0500
++++ examples/PrintHtml.java 2007-01-16 06:07:11.461278000 -0500
+@@ -0,0 +1,99 @@
++import java.awt.Dimension;
++import java.awt.Graphics;
++import java.awt.Graphics2D;
++
++import java.awt.print.PageFormat;
++import java.awt.print.Printable;
++
++import java.io.BufferedReader;
++import java.io.FileReader;
++import java.io.OutputStream;
++import java.io.PrintWriter;
++import java.io.StringWriter;
++
++import javax.print.Doc;
++import javax.print.DocFlavor;
++import javax.print.DocPrintJob;
++import javax.print.PrintService;
++import javax.print.SimpleDoc;
++import javax.print.StreamPrintServiceFactory;
++
++import javax.swing.JEditorPane;
++import javax.swing.JFrame;
++import javax.swing.RepaintManager;
++
++import javax.swing.text.html.HTMLEditorKit;
++
++import jcifs.Config;
++
++import jcifs.smb.SmbFileOutputStream;
++
++public class PrintHtml {
++
++    public static void main(String[] args) throws Exception {
++        Config.setProperty("jcifs.smb.client.useNTSmbs", "false");
++        String htmlFile = args[0];
++        String printerUrl = args[1];
++        StringWriter collector = new StringWriter();
++        PrintWriter writer = new PrintWriter(collector);
++        BufferedReader reader = new BufferedReader(new FileReader(htmlFile));
++        String line;
++        while ((line = reader.readLine()) != null) writer.println(line);
++        writer.flush();
++        String content = collector.toString();
++        final JEditorPane pane = new JEditorPane();
++        pane.setEditorKit(new HTMLEditorKit());
++        pane.setText(content);
++        JFrame frame = new JFrame();
++        frame.getContentPane().add(pane);
++        frame.pack();
++        Printable printable = new Printable() {
++            public int print(Graphics g, PageFormat format, int pageIndex) {
++                RepaintManager currentManager =
++                        RepaintManager.currentManager(pane);
++                boolean doubleBuffering =
++                        currentManager.isDoubleBufferingEnabled();
++                if (doubleBuffering) {
++                    currentManager.setDoubleBufferingEnabled(false);
++                }
++                try {
++                    Dimension size = pane.getSize();
++                    double panelWidth = size.width;
++                    double panelHeight = size.height;
++                    double pageHeight = format.getImageableHeight();
++                    double pageWidth = format.getImageableWidth();
++                    double scale = pageWidth / panelWidth;
++                    int totalNumPages = (int)
++                            Math.ceil(scale * panelHeight / pageHeight);
++                    if (pageIndex >= totalNumPages) {
++                        return Printable.NO_SUCH_PAGE;
++                    }
++                    Graphics2D g2 = (Graphics2D) g;
++                    g2.translate(format.getImageableX(),
++                            format.getImageableY());
++                    g2.translate(0f, -pageIndex * pageHeight);
++                    g2.scale(scale, scale);
++                    pane.paint(g2);
++                    return Printable.PAGE_EXISTS;
++                } finally {
++                    if (doubleBuffering) {
++                        currentManager.setDoubleBufferingEnabled(true);
++                    }
++                }
++            }
++        };
++        DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
++        Doc doc = new SimpleDoc(printable, flavor, null);
++        StreamPrintServiceFactory[] factories =
++                StreamPrintServiceFactory.lookupStreamPrintServiceFactories(
++                        null, "application/postscript");
++        OutputStream output = new SmbFileOutputStream(printerUrl);
++        PrintService service = factories[0].getPrintService(output);
++        DocPrintJob job = service.createPrintJob();
++        job.print(doc, null);
++        output.flush();
++        output.close();
++        System.exit(0);
++    }
++
++}
index 538a146..f99d203 100644 (file)
@@ -2,6 +2,16 @@ These patches are not supported. They are provided here only for your
 conveinience. If you port a patch to a newer version of jCIFS please
 resubmit it to the mailing list.
 
+Print.patch
+
+This minor patch and example program demonstrates how to emit
+PostScript rendered from an AWT/Swing Graphics context and send it
+directly to a shared printer. Note that currently you also need to set
+jcifs.smb.client.useNTSmbs = false (as otherwise the server spits back
+an invalid parameter error). If users determine that this feature works
+reliably with a wide variety of printers we will incorporate it into
+the distribution (and fix the useNTSmbs goof).
+
 DnsSrv.patch
 
 This patch adds JNDI _ldap._tcp.dc._msdcs.<domain> lookups so that the