annotate servlet/src/digilib/Utils.java @ 139:11cfe4c89fdc

Servlet version 1.11b1 with improved original-size. - fixed lots of bugs in metadata handling.
author robcast
date Thu, 31 Jul 2003 20:56:51 +0200
parents 5d44cd2481a5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
1 /* Utils -- general utility classes for scaler servlet
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
2
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
3 Digital Image Library servlet components
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
4
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
5 Copyright (C) 2001, 2002 Robert Casties (robcast@mail.berlios.de)
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
6
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
7 This program is free software; you can redistribute it and/or modify it
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
9 Free Software Foundation; either version 2 of the License, or (at your
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
10 option) any later version.
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
11
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
12 Please read license.txt for the full details. A copy of the GPL
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
13 may be found at http://www.gnu.org/copyleft/lgpl.html
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
14
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
16 along with this program; if not, write to the Free Software
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
18
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
19 */
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
20
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
21 package digilib;
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
22
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
23 public class Utils {
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
24
87
5d44cd2481a5 New version 1.8b4.
robcast
parents: 71
diff changeset
25 private int debugLevel = 10;
5d44cd2481a5 New version 1.8b4.
robcast
parents: 71
diff changeset
26
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
27 public Utils() {
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
28 }
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
29
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
30 public Utils(int dbg) {
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
31 debugLevel = dbg;
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
32 }
59
8d9a0abf3626 Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents: 1
diff changeset
33
8d9a0abf3626 Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents: 1
diff changeset
34 public void setDebugLevel(int lvl) {
8d9a0abf3626 Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents: 1
diff changeset
35 debugLevel = lvl;
8d9a0abf3626 Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents: 1
diff changeset
36 }
8d9a0abf3626 Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents: 1
diff changeset
37 public int getDebugLevel() {
8d9a0abf3626 Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents: 1
diff changeset
38 return debugLevel;
8d9a0abf3626 Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents: 1
diff changeset
39 }
8d9a0abf3626 Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents: 1
diff changeset
40
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
41 /**
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
42 * Debugging help
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
43 * dprintln(1, "blabla");
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
44 * will be printed on stdout if debug >= 1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
45 */
71
d493563ef672 New servlet version 1.5b.
robcast
parents: 59
diff changeset
46 public void dprintln(int dbg, String s) {
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
47 if (debugLevel >= dbg) {
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
48 String ind = "";
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
49 // indent by debuglevel
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
50 for (int i = 0; i < dbg; i++) {
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
51 ind += " ";
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
52 }
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
53 System.out.println(ind+s);
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
54 }
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
55 }
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
56 }