Source code: com/ciphermod/DmcaClient.java
1 /* $Id: DmcaClient.java,v 1.1 2001/03/22 12:03:45 cvsbob Exp $ */
2
3 /*
4 * DmcaClient.java, CipherCore extension for DMCA protection.
5 * Copyright (C) 2001 Robert Bushman.
6 *
7 * I reserve the right to release this program under seperate license.
8 * If you require a special license grant contact Robert Bushman.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 * 02111-1307, USA.
24 */
25
26 package com.ciphermod;
27
28 import java.io.InputStream;
29 import java.io.OutputStream;
30
31 import com.ciphercore.Client;
32 import com.traxel.io.CopyrightedInputStream;
33 import com.traxel.io.CopyrightedOutputStream;
34
35 /**
36 * DmcaClient is an extension for com.ciphercore.Client.
37 * It wraps the encrypted streams in CopyrightedStreams.
38 * As a result, it is a violation of the DMCA to break
39 * the encryption.
40 */
41 public class DmcaClient extends Client {
42
43 // ----------------------------------------------------------
44 // CONSTRUCTORS
45 // ----------------------------------------------------------
46
47 public DmcaClient( String childClassName ) {
48 super( childClassName );
49 }
50
51 public DmcaClient( String childClassName,
52 String hostName,
53 int port ) {
54 super( childClassName, hostName, port );
55 }
56
57 // ------------------------------------------------------------
58 // OVERRIDES
59 // ------------------------------------------------------------
60
61 /**
62 * Override com.ciphercore.Client's method with a method
63 * that wraps the CipherInputStream in a CopyrightedInputStream.
64 */
65 protected void setBaseInputStream( InputStream baseIn ) {
66 baseIn = new CopyrightedInputStream( baseIn );
67 super.setBaseInputStream( baseIn );
68 }
69
70 /**
71 * Override com.ciphercore.Client's method with a method
72 * that wraps the CipherOutputStream in a CopyrightedOutputStream.
73 */
74 protected void setBaseOutputStream( OutputStream baseOut ) {
75 baseOut = new CopyrightedOutputStream( baseOut );
76 super.setBaseOutputStream( baseOut );
77 }
78 }
79