01: /*
02: *
03: */
04: package org.enhydra.snapperAdmin.spec;
05:
06: import org.enhydra.snapperAdmin.spec.Download;
07:
08: public class DownloadFactory {
09:
10: /**
11: * Constructor can't be used.
12: */
13: private DownloadFactory() {
14: }
15:
16: /**
17: * Create a Download as state object/value object/data transfer object
18: */
19: public static Download getDownload(String fullClassName)
20: throws Exception {
21:
22: Download result = null;
23:
24: Class objectClass = null;
25:
26: try {
27: // Create the value object
28:
29: objectClass = Class.forName(fullClassName);
30:
31: result = (Download) objectClass.newInstance();
32:
33: } catch (Exception ex) {
34: System.out.println("Error on creating the object: " + ex);
35: }
36:
37: return result;
38: }
39:
40: }
|