Skip to content

Commit

Permalink
Additional CD-ROM mount point for Linux. #271
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed May 18, 2022
1 parent 2357b39 commit 6f94d48
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
package org.weasis.dicom.explorer;

import com.formdev.flatlaf.util.SystemInfo;
import java.awt.Dialog;
import java.io.File;
import java.net.URI;
Expand All @@ -26,7 +27,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.weasis.core.api.gui.util.AbstractItemDialogPage;
import org.weasis.core.api.gui.util.AppProperties;
import org.weasis.core.api.gui.util.GuiUtils;
import org.weasis.core.api.gui.util.WinUtil;
import org.weasis.core.api.util.ResourceUtil;
Expand Down Expand Up @@ -202,14 +202,16 @@ private static void addFiles(List<File> dvs, File folder) {
public static File getDcmDirFromMedia() {
final List<File> dvs = new ArrayList<>();
try {
if (AppProperties.OPERATING_SYSTEM.startsWith("win")) { // NON-NLS
if (SystemInfo.isWindows) {
dvs.addAll(Arrays.asList(File.listRoots()));
} else if (AppProperties.OPERATING_SYSTEM.startsWith("mac")) { // NON-NLS
} else if (SystemInfo.isMacOS) {
addFiles(dvs, new File("/Volumes"));
} else {
addFiles(dvs, new File("/media"));
addFiles(dvs, new File("/mnt"));
addFiles(dvs, new File("/media/" + System.getProperty("user.name", "local"))); // NON-NLS
String user = System.getProperty("user.name", "local"); // NON-NLS
addFiles(dvs, new File("/media/" + user ));
addFiles(dvs, new File("/run/media/" + user ));
}
} catch (Exception e) {
LOGGER.error("Error when reading device directories: {}", e.getMessage());
Expand Down

0 comments on commit 6f94d48

Please sign in to comment.