Autopsy  4.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ImageExtractor.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2015 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.modules.embeddedfileextractor;
20 
21 import java.io.File;
22 import java.io.FileOutputStream;
23 import java.io.IOException;
24 import java.nio.file.Paths;
25 import java.util.ArrayList;
26 import java.util.List;
27 import java.util.logging.Level;
28 import org.apache.poi.hslf.model.Picture;
29 import org.apache.poi.hslf.usermodel.PictureData;
30 import org.apache.poi.hslf.usermodel.SlideShow;
31 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
32 import org.apache.poi.hwpf.HWPFDocument;
33 import org.apache.poi.hwpf.model.PicturesTable;
34 import org.apache.poi.ss.usermodel.Workbook;
35 import org.apache.poi.xslf.usermodel.XMLSlideShow;
36 import org.apache.poi.xslf.usermodel.XSLFPictureData;
37 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
38 import org.apache.poi.xwpf.usermodel.XWPFDocument;
39 import org.apache.poi.xwpf.usermodel.XWPFPictureData;
40 import org.openide.util.NbBundle;
48 import org.sleuthkit.datamodel.AbstractFile;
49 import org.sleuthkit.datamodel.ReadContentInputStream;
50 import org.sleuthkit.datamodel.TskCoreException;
51 
52 class ImageExtractor {
53 
54  private final FileManager fileManager;
55  private final IngestServices services;
56  private static final Logger logger = Logger.getLogger(ImageExtractor.class.getName());
57  private final IngestJobContext context;
58  private String parentFileName;
59  private final String UNKNOWN_NAME_PREFIX = "image_"; //NON-NLS
60  private final FileTypeDetector fileTypeDetector;
61 
62  private String moduleDirRelative;
63  private String moduleDirAbsolute;
64 
68  enum SupportedImageExtractionFormats {
69 
70  DOC("application/msword"), //NON-NLS
71  DOCX("application/vnd.openxmlformats-officedocument.wordprocessingml.document"), //NON-NLS
72  PPT("application/vnd.ms-powerpoint"), //NON-NLS
73  PPTX("application/vnd.openxmlformats-officedocument.presentationml.presentation"), //NON-NLS
74  XLS("application/vnd.ms-excel"), //NON-NLS
75  XLSX("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); //NON-NLS
76 
77  private final String mimeType;
78 
79  SupportedImageExtractionFormats(final String mimeType) {
80  this.mimeType = mimeType;
81  }
82 
83  @Override
84  public String toString() {
85  return this.mimeType;
86  }
87  // TODO Expand to support more formats
88  }
89  private SupportedImageExtractionFormats abstractFileExtractionFormat;
90 
91  ImageExtractor(IngestJobContext context, FileTypeDetector fileTypeDetector, String moduleDirRelative, String moduleDirAbsolute) {
92 
93  this.fileManager = Case.getCurrentCase().getServices().getFileManager();
94  this.services = IngestServices.getInstance();
95  this.context = context;
96  this.fileTypeDetector = fileTypeDetector;
97  this.moduleDirRelative = moduleDirRelative;
98  this.moduleDirAbsolute = moduleDirAbsolute;
99  }
100 
110  boolean isImageExtractionSupported(AbstractFile abstractFile) {
111  try {
112  String abstractFileMimeType = fileTypeDetector.getFileType(abstractFile);
113  for (SupportedImageExtractionFormats s : SupportedImageExtractionFormats.values()) {
114  if (s.toString().equals(abstractFileMimeType)) {
115  abstractFileExtractionFormat = s;
116  return true;
117  }
118  }
119  return false;
120  } catch (TskCoreException ex) {
121  logger.log(Level.WARNING, "Error executing FileTypeDetector.getFileType()", ex); // NON-NLS
122  return false;
123  }
124  }
125 
135  void extractImage(AbstractFile abstractFile) {
136  //
137  // switchcase for different supported formats
138  // process abstractFile according to the format by calling appropriate methods.
139 
140  List<ExtractedImage> listOfExtractedImages = null;
141  List<AbstractFile> listOfExtractedImageAbstractFiles = null;
142  this.parentFileName = EmbeddedFileExtractorIngestModule.getUniqueName(abstractFile);
143  //check if already has derived files, skip
144  try {
145  if (abstractFile.hasChildren()) {
146  //check if local unpacked dir exists
147  if (new File(getOutputFolderPath(parentFileName)).exists()) {
148  logger.log(Level.INFO, "File already has been processed as it has children and local unpacked file, skipping: {0}", abstractFile.getName()); //NON-NLS
149  return;
150  }
151  }
152  } catch (TskCoreException e) {
153  logger.log(Level.INFO, "Error checking if file already has been processed, skipping: {0}", parentFileName); //NON-NLS
154  return;
155  }
156  switch (abstractFileExtractionFormat) {
157  case DOC:
158  listOfExtractedImages = extractImagesFromDoc(abstractFile);
159  break;
160  case DOCX:
161  listOfExtractedImages = extractImagesFromDocx(abstractFile);
162  break;
163  case PPT:
164  listOfExtractedImages = extractImagesFromPpt(abstractFile);
165  break;
166  case PPTX:
167  listOfExtractedImages = extractImagesFromPptx(abstractFile);
168  break;
169  case XLS:
170  listOfExtractedImages = extractImagesFromXls(abstractFile);
171  break;
172  case XLSX:
173  listOfExtractedImages = extractImagesFromXlsx(abstractFile);
174  break;
175  default:
176  break;
177  }
178 
179  if (listOfExtractedImages == null) {
180  return;
181  }
182  // the common task of adding abstractFile to derivedfiles is performed.
183  listOfExtractedImageAbstractFiles = new ArrayList<>();
184  for (ExtractedImage extractedImage : listOfExtractedImages) {
185  try {
186  listOfExtractedImageAbstractFiles.add(fileManager.addDerivedFile(extractedImage.getFileName(), extractedImage.getLocalPath(), extractedImage.getSize(),
187  extractedImage.getCtime(), extractedImage.getCrtime(), extractedImage.getAtime(), extractedImage.getAtime(),
188  true, abstractFile, null, EmbeddedFileExtractorModuleFactory.getModuleName(), null, null));
189  } catch (TskCoreException ex) {
190  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImage.addToDB.exception.msg"), ex); //NON-NLS
191  }
192  }
193  if (!listOfExtractedImages.isEmpty()) {
194  services.fireModuleContentEvent(new ModuleContentEvent(abstractFile));
195  context.addFilesToJob(listOfExtractedImageAbstractFiles);
196  }
197  }
198 
207  private List<ExtractedImage> extractImagesFromDoc(AbstractFile af) {
208  List<ExtractedImage> listOfExtractedImages;
209  HWPFDocument doc = null;
210  try {
211  doc = new HWPFDocument(new ReadContentInputStream(af));
212  } catch (Throwable ignore) {
213  // instantiating POI containers throw RuntimeExceptions
214  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.docContainer.init.err", af.getName())); //NON-NLS
215  return null;
216  }
217 
218  PicturesTable pictureTable = null;
219  List<org.apache.poi.hwpf.usermodel.Picture> listOfAllPictures = null;
220  try {
221  pictureTable = doc.getPicturesTable();
222  listOfAllPictures = pictureTable.getAllPictures();
223  } catch (Exception ignore) {
224  // log internal Java and Apache errors as WARNING
225  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
226  return null;
227  }
228 
229  String outputFolderPath;
230  if (listOfAllPictures.isEmpty()) {
231  return null;
232  } else {
233  outputFolderPath = getOutputFolderPath(this.parentFileName);
234  }
235  if (outputFolderPath == null) {
236  return null;
237  }
238  listOfExtractedImages = new ArrayList<>();
239  byte[] data = null;
240  for (org.apache.poi.hwpf.usermodel.Picture picture : listOfAllPictures) {
241  String fileName = picture.suggestFullFileName();
242  try {
243  data = picture.getContent();
244  } catch (Exception ignore) {
245  // log internal Java and Apache errors as WARNING
246  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
247  return null;
248  }
249  writeExtractedImage(Paths.get(outputFolderPath, fileName).toString(), data);
250  // TODO Extract more info from the Picture viz ctime, crtime, atime, mtime
251  listOfExtractedImages.add(new ExtractedImage(fileName, getFileRelativePath(fileName), picture.getSize(), af));
252  }
253 
254  return listOfExtractedImages;
255  }
256 
265  private List<ExtractedImage> extractImagesFromDocx(AbstractFile af) {
266  List<ExtractedImage> listOfExtractedImages;
267  XWPFDocument docx = null;
268  try {
269  docx = new XWPFDocument(new ReadContentInputStream(af));
270  } catch (Throwable ignore) {
271  // instantiating POI containers throw RuntimeExceptions
272  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.docxContainer.init.err", af.getName())); //NON-NLS
273  return null;
274  }
275  List<XWPFPictureData> listOfAllPictures = null;
276  try {
277  listOfAllPictures = docx.getAllPictures();
278  } catch (Exception ignore) {
279  // log internal Java and Apache errors as WARNING
280  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
281  return null;
282  }
283 
284  // if no images are extracted from the PPT, return null, else initialize
285  // the output folder for image extraction.
286  String outputFolderPath;
287  if (listOfAllPictures.isEmpty()) {
288  return null;
289  } else {
290  outputFolderPath = getOutputFolderPath(this.parentFileName);
291  }
292  if (outputFolderPath == null) {
293  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS
294  return null;
295  }
296  listOfExtractedImages = new ArrayList<>();
297  byte[] data = null;
298  for (XWPFPictureData xwpfPicture : listOfAllPictures) {
299  String fileName = xwpfPicture.getFileName();
300  try {
301  data = xwpfPicture.getData();
302  } catch (Exception ignore) {
303  // log internal Java and Apache errors as WARNING
304  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
305  return null;
306  }
307  writeExtractedImage(Paths.get(outputFolderPath, fileName).toString(), data);
308  listOfExtractedImages.add(new ExtractedImage(fileName, getFileRelativePath(fileName), xwpfPicture.getData().length, af));
309  }
310  return listOfExtractedImages;
311  }
312 
321  private List<ExtractedImage> extractImagesFromPpt(AbstractFile af) {
322  List<ExtractedImage> listOfExtractedImages;
323  SlideShow ppt = null;
324  try {
325  ppt = new SlideShow(new ReadContentInputStream(af));
326  } catch (Throwable ignore) {
327  // instantiating POI containers throw RuntimeExceptions
328  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.pptContainer.init.err", af.getName())); //NON-NLS
329  return null;
330  }
331 
332  //extract all pictures contained in the presentation
333  PictureData[] listOfAllPictures = null;
334  try {
335  listOfAllPictures = ppt.getPictureData();
336  } catch (Exception ignore) {
337  // log internal Java and Apache errors as WARNING
338  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
339  return null;
340  }
341 
342  // if no images are extracted from the PPT, return null, else initialize
343  // the output folder for image extraction.
344  String outputFolderPath;
345  if (listOfAllPictures.length == 0) {
346  return null;
347  } else {
348  outputFolderPath = getOutputFolderPath(this.parentFileName);
349  }
350  if (outputFolderPath == null) {
351  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS
352  return null;
353  }
354 
355  // extract the images to the above initialized outputFolder.
356  // extraction path - outputFolder/image_number.ext
357  int i = 0;
358  listOfExtractedImages = new ArrayList<>();
359  byte[] data = null;
360  for (PictureData pictureData : listOfAllPictures) {
361 
362  // Get image extension, generate image name, write image to the module
363  // output folder, add it to the listOfExtractedImageAbstractFiles
364  int type = pictureData.getType();
365  String ext;
366  switch (type) {
367  case Picture.JPEG:
368  ext = ".jpg"; //NON-NLS
369  break;
370  case Picture.PNG:
371  ext = ".png"; //NON-NLS
372  break;
373  case Picture.WMF:
374  ext = ".wmf"; //NON-NLS
375  break;
376  case Picture.EMF:
377  ext = ".emf"; //NON-NLS
378  break;
379  case Picture.PICT:
380  ext = ".pict"; //NON-NLS
381  break;
382  default:
383  continue;
384  }
385  String imageName = UNKNOWN_NAME_PREFIX + i + ext; //NON-NLS
386  try {
387  data = pictureData.getData();
388  } catch (Exception ignore) {
389  // log internal Java and Apache errors as WARNING
390  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
391  return null;
392  }
393  writeExtractedImage(Paths.get(outputFolderPath, imageName).toString(), data);
394  listOfExtractedImages.add(new ExtractedImage(imageName, getFileRelativePath(imageName), pictureData.getData().length, af));
395  i++;
396  }
397  return listOfExtractedImages;
398  }
399 
408  private List<ExtractedImage> extractImagesFromPptx(AbstractFile af) {
409  List<ExtractedImage> listOfExtractedImages;
410  XMLSlideShow pptx;
411  try {
412  pptx = new XMLSlideShow(new ReadContentInputStream(af));
413  } catch (Throwable ignore) {
414  // instantiating POI containers throw RuntimeExceptions
415  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.pptxContainer.init.err", af.getName())); //NON-NLS
416  return null;
417  }
418  List<XSLFPictureData> listOfAllPictures = null;
419  try {
420  listOfAllPictures = pptx.getAllPictures();
421  } catch (Exception ignore) {
422  // log internal Java and Apache errors as WARNING
423  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
424  return null;
425  }
426 
427  // if no images are extracted from the PPT, return null, else initialize
428  // the output folder for image extraction.
429  String outputFolderPath;
430  if (listOfAllPictures.isEmpty()) {
431  return null;
432  } else {
433  outputFolderPath = getOutputFolderPath(this.parentFileName);
434  }
435  if (outputFolderPath == null) {
436  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS
437  return null;
438  }
439 
440  listOfExtractedImages = new ArrayList<>();
441  byte[] data = null;
442  for (XSLFPictureData xslsPicture : listOfAllPictures) {
443 
444  // get image file name, write it to the module outputFolder, and add
445  // it to the listOfExtractedImageAbstractFiles.
446  String fileName = xslsPicture.getFileName();
447  try {
448  data = xslsPicture.getData();
449  } catch (Exception ignore) {
450  // log internal Java and Apache errors as WARNING
451  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
452  return null;
453  }
454  writeExtractedImage(Paths.get(outputFolderPath, fileName).toString(), data);
455  listOfExtractedImages.add(new ExtractedImage(fileName, getFileRelativePath(fileName), xslsPicture.getData().length, af));
456 
457  }
458 
459  return listOfExtractedImages;
460 
461  }
462 
471  private List<ExtractedImage> extractImagesFromXls(AbstractFile af) {
472  List<ExtractedImage> listOfExtractedImages;
473 
474  Workbook xls;
475  try {
476  xls = new HSSFWorkbook(new ReadContentInputStream(af));
477  } catch (Throwable ignore) {
478  // instantiating POI containers throw RuntimeExceptions
479  logger.log(Level.WARNING, "{0}{1}", new Object[]{NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.xlsContainer.init.err", af.getName()), af.getName()}); //NON-NLS
480  return null;
481  }
482 
483  List<? extends org.apache.poi.ss.usermodel.PictureData> listOfAllPictures = null;
484  try {
485  listOfAllPictures = xls.getAllPictures();
486  } catch (Exception ignore) {
487  // log internal Java and Apache errors as WARNING
488  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
489  return null;
490  }
491 
492  // if no images are extracted from the PPT, return null, else initialize
493  // the output folder for image extraction.
494  String outputFolderPath;
495  if (listOfAllPictures.isEmpty()) {
496  return null;
497  } else {
498  outputFolderPath = getOutputFolderPath(this.parentFileName);
499  }
500  if (outputFolderPath == null) {
501  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS
502  return null;
503  }
504 
505  int i = 0;
506  listOfExtractedImages = new ArrayList<>();
507  byte[] data = null;
508  for (org.apache.poi.ss.usermodel.PictureData pictureData : listOfAllPictures) {
509  String imageName = UNKNOWN_NAME_PREFIX + i + "." + pictureData.suggestFileExtension(); //NON-NLS
510  try {
511  data = pictureData.getData();
512  } catch (Exception ignore) {
513  // log internal Java and Apache errors as WARNING
514  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
515  return null;
516  }
517  writeExtractedImage(Paths.get(outputFolderPath, imageName).toString(), data);
518  listOfExtractedImages.add(new ExtractedImage(imageName, getFileRelativePath(imageName), pictureData.getData().length, af));
519  i++;
520  }
521  return listOfExtractedImages;
522 
523  }
524 
533  private List<ExtractedImage> extractImagesFromXlsx(AbstractFile af) {
534  List<ExtractedImage> listOfExtractedImages;
535  Workbook xlsx;
536  try {
537  xlsx = new XSSFWorkbook(new ReadContentInputStream(af));
538  } catch (Throwable ignore) {
539  // instantiating POI containers throw RuntimeExceptions
540  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.xlsxContainer.init.err", af.getName())); //NON-NLS
541  return null;
542  }
543 
544  List<? extends org.apache.poi.ss.usermodel.PictureData> listOfAllPictures = null;
545  try {
546  listOfAllPictures = xlsx.getAllPictures();
547  } catch (Exception ignore) {
548  // log internal Java and Apache errors as WARNING
549  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
550  return null;
551  }
552 
553  // if no images are extracted from the PPT, return null, else initialize
554  // the output folder for image extraction.
555  String outputFolderPath;
556  if (listOfAllPictures.isEmpty()) {
557  return null;
558  } else {
559  outputFolderPath = getOutputFolderPath(this.parentFileName);
560  }
561  if (outputFolderPath == null) {
562  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS
563  return null;
564  }
565 
566  int i = 0;
567  listOfExtractedImages = new ArrayList<>();
568  byte[] data = null;
569  for (org.apache.poi.ss.usermodel.PictureData pictureData : listOfAllPictures) {
570  String imageName = UNKNOWN_NAME_PREFIX + i + "." + pictureData.suggestFileExtension();
571  try {
572  data = pictureData.getData();
573  } catch (Exception ignore) {
574  // log internal Java and Apache errors as WARNING
575  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName())); //NON-NLS
576  return null;
577  }
578  writeExtractedImage(Paths.get(outputFolderPath, imageName).toString(), data);
579  listOfExtractedImages.add(new ExtractedImage(imageName, getFileRelativePath(imageName), pictureData.getData().length, af));
580  i++;
581  }
582  return listOfExtractedImages;
583 
584  }
585 
593  private void writeExtractedImage(String outputPath, byte[] data) {
594  try (FileOutputStream fos = new FileOutputStream(outputPath)) {
595  fos.write(data);
596  } catch (IOException ex) {
597  logger.log(Level.WARNING, "Could not write to the provided location: " + outputPath, ex); //NON-NLS
598  }
599  }
600 
610  private String getOutputFolderPath(String parentFileName) {
611  String outputFolderPath = moduleDirAbsolute + File.separator + parentFileName;
612  File outputFilePath = new File(outputFolderPath);
613  if (!outputFilePath.exists()) {
614  try {
615  outputFilePath.mkdirs();
616  } catch (SecurityException ex) {
617  logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.getOutputFolderPath.exception.msg", parentFileName), ex);
618  return null;
619  }
620  }
621  return outputFolderPath;
622  }
623 
633  private String getFileRelativePath(String fileName) {
634  // Used explicit FWD slashes to maintain DB consistency across operating systems.
635  return "/" + moduleDirRelative + "/" + this.parentFileName + "/" + fileName; //NON-NLS
636  }
637 
643  private static class ExtractedImage {
644  //String fileName, String localPath, long size, long ctime, long crtime,
645  //long atime, long mtime, boolean isFile, AbstractFile parentFile, String rederiveDetails, String toolName, String toolVersion, String otherDetails
646 
647  private final String fileName;
648  private final String localPath;
649  private final long size;
650  private final long ctime;
651  private final long crtime;
652  private final long atime;
653  private final long mtime;
654  private final AbstractFile parentFile;
655 
656  ExtractedImage(String fileName, String localPath, long size, AbstractFile parentFile) {
657  this(fileName, localPath, size, 0, 0, 0, 0, parentFile);
658  }
659 
660  ExtractedImage(String fileName, String localPath, long size, long ctime, long crtime, long atime, long mtime, AbstractFile parentFile) {
661  this.fileName = fileName;
662  this.localPath = localPath;
663  this.size = size;
664  this.ctime = ctime;
665  this.crtime = crtime;
666  this.atime = atime;
667  this.mtime = mtime;
668  this.parentFile = parentFile;
669  }
670 
671  public String getFileName() {
672  return fileName;
673  }
674 
675  public String getLocalPath() {
676  return localPath;
677  }
678 
679  public long getSize() {
680  return size;
681  }
682 
683  public long getCtime() {
684  return ctime;
685  }
686 
687  public long getCrtime() {
688  return crtime;
689  }
690 
691  public long getAtime() {
692  return atime;
693  }
694 
695  public long getMtime() {
696  return mtime;
697  }
698 
699  public AbstractFile getParentFile() {
700  return parentFile;
701  }
702  }
703 }

Copyright © 2012-2015 Basis Technology. Generated on: Wed Apr 6 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.