~ubuntu-dev/sleuthkit/trunk

« back to all changes in this revision

Viewing changes to bindings/java/src/org/sleuthkit/datamodel/SleuthkitJNI.java

  • Committer: carriersvn
  • Date: 2011-10-05 02:47:12 UTC
  • Revision ID: svn-v4:1db85b72-fc57-0410-9196-8d408266ab40:trunk:399
udpated multi-image database code. Patch by Peter Martel

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
                                autoDbPointer = 0;
95
95
                        }
96
96
                        
 
97
                        /**
 
98
                         * Add an image to the case database. MUST call either commit() or
 
99
                         * revert() after calling run().
 
100
                         * @param imgPath Full path(s) to the image file(s).
 
101
                         * @throws TskException
 
102
                         */
97
103
                        public void run(String[] imgPath) throws TskException {
98
104
                                if (autoDbPointer != 0) {
99
105
                                        throw new IllegalStateException("AddImageProcess can only be run once");
103
109
                                runAddImgNat(autoDbPointer, imgPath, imgPath.length);
104
110
                        }
105
111
                        
 
112
                        /**
 
113
                         * Call while run() is executing in another thread to prematurely
 
114
                         * halt the process. Must call revert() in the other thread once
 
115
                         * the stopped run() returns.
 
116
                         * @throws TskException
 
117
                         */
106
118
                        public void stop() throws TskException {
107
119
                                if (autoDbPointer == 0) {
108
120
                                        throw new IllegalStateException("Can't stop an AddImageProcess that hasn't been run.");
111
123
                                stopAddImgNat(autoDbPointer);
112
124
                        }
113
125
                        
 
126
                        /**
 
127
                         * Rollback a process that has already been run(), reverting the
 
128
                         * database.
 
129
                         * @throws TskException
 
130
                         */
114
131
                        public void revert() throws TskException {
115
132
                                if (autoDbPointer == 0) {
116
133
                                        throw new IllegalStateException("Can't revert an AddImageProcess that hasn't been run.");
119
136
                                revertAddImgNat(autoDbPointer);
120
137
                        }
121
138
                        
 
139
                        /**
 
140
                         * Finish off a process that has already been run(), closing the
 
141
                         * transaction and committing the new image data to the database.
 
142
                         * @return The id of the image that was added.
 
143
                         * @throws TskException 
 
144
                         */
122
145
                        public long commit() throws TskException {
123
146
                                if (autoDbPointer == 0) {
124
147
                                        throw new IllegalStateException("Can't commit an AddImageProcess that hasn't been run.");
168
191
         * @throws TskException
169
192
         */
170
193
        public static long openImage(String[] imageDirs) throws TskException{
171
 
                System.out.println(imageDirs[0]);
172
194
                return openImgNat(imageDirs, imageDirs.length);
173
195
        }
174
196