List of usage examples for javax.activation FileDataSource setFileTypeMap
public void setFileTypeMap(FileTypeMap map)
From source file:eu.planets_project.services.datatypes.ImmutableContent.java
/** * @param reference The content reference, as a file. *///from ww w.jav a2 s . c om ImmutableContent(final File reference) { if (reference == null) throw new IllegalArgumentException("File parameter must not be null!"); FileDataSource ds = new FileDataSource(reference); ds.setFileTypeMap(FileTypeMap.getDefaultFileTypeMap()); DataHandler dh = new DataHandler(ds); this.length = reference.length(); this.dataHandler = dh; log.info("Created Content from file: " + reference.getAbsolutePath() + "': " + this.length + " bytes in length."); }