From e2105771c0e62a40b37833fbc9ebec577868e76b Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 6 Mar 2017 20:52:04 +0800 Subject: [PATCH] Move platform-specific utilities into net.filebot.platform.* package --- source/net/filebot/Main.java | 4 ++-- source/net/filebot/MetaAttributeView.java | 2 +- source/net/filebot/UserFiles.java | 2 +- source/net/filebot/format/ExpressionFormatFunctions.java | 2 +- source/net/filebot/{gio => platform/gnome}/GVFS.java | 2 +- source/net/filebot/{gio => platform/gnome}/LibGIO.java | 2 +- source/net/filebot/{gio => platform/gnome}/NativeGVFS.java | 2 +- source/net/filebot/{gio => platform/gnome}/PlatformGVFS.java | 2 +- source/net/filebot/{ => platform}/mac/DropToUnlock.java | 4 ++-- source/net/filebot/{ => platform}/mac/MacAppUtilities.java | 2 +- source/net/filebot/{ => platform}/mac/MacXattrView.java | 2 +- .../filebot/{win => platform/windows}/WinAppUtilities.java | 2 +- source/net/filebot/ui/MainFrame.java | 2 +- source/net/filebot/ui/filter/FileTreeTransferablePolicy.java | 2 +- source/net/filebot/ui/rename/FormatDialog.java | 2 +- source/net/filebot/ui/rename/HistoryDialog.java | 2 +- source/net/filebot/ui/rename/PresetEditor.java | 2 +- source/net/filebot/ui/rename/RenameAction.java | 2 +- source/net/filebot/ui/rename/RenamePanel.java | 2 +- .../net/filebot/ui/sfv/ChecksumTableTransferablePolicy.java | 2 +- source/net/filebot/ui/subtitle/SubtitleAutoMatchDialog.java | 2 +- source/net/filebot/ui/subtitle/SubtitleDropTarget.java | 2 +- source/net/filebot/ui/transfer/FileTransferable.java | 2 +- test/net/filebot/gio/PlatformGVFSTest.java | 3 +++ test/net/filebot/web/TMDbClientTest.java | 1 - 25 files changed, 28 insertions(+), 26 deletions(-) rename source/net/filebot/{gio => platform/gnome}/GVFS.java (92%) rename source/net/filebot/{gio => platform/gnome}/LibGIO.java (90%) rename source/net/filebot/{gio => platform/gnome}/NativeGVFS.java (95%) rename source/net/filebot/{gio => platform/gnome}/PlatformGVFS.java (98%) rename source/net/filebot/{ => platform}/mac/DropToUnlock.java (99%) rename source/net/filebot/{ => platform}/mac/MacAppUtilities.java (99%) rename source/net/filebot/{ => platform}/mac/MacXattrView.java (95%) rename source/net/filebot/{win => platform/windows}/WinAppUtilities.java (96%) diff --git a/source/net/filebot/Main.java b/source/net/filebot/Main.java index 0a0877f0..9dadb067 100644 --- a/source/net/filebot/Main.java +++ b/source/net/filebot/Main.java @@ -38,7 +38,8 @@ import net.filebot.cli.ArgumentBean; import net.filebot.cli.ArgumentProcessor; import net.filebot.cli.CmdlineException; import net.filebot.format.ExpressionFormat; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; +import net.filebot.platform.windows.WinAppUtilities; import net.filebot.ui.FileBotMenuBar; import net.filebot.ui.GettingStartedStage; import net.filebot.ui.MainFrame; @@ -49,7 +50,6 @@ import net.filebot.ui.SupportDialog; import net.filebot.ui.transfer.FileTransferable; import net.filebot.util.PreferencesMap.PreferencesEntry; import net.filebot.util.ui.SwingEventBus; -import net.filebot.win.WinAppUtilities; import net.miginfocom.swing.MigLayout; public class Main { diff --git a/source/net/filebot/MetaAttributeView.java b/source/net/filebot/MetaAttributeView.java index b947417f..8aa3d9aa 100644 --- a/source/net/filebot/MetaAttributeView.java +++ b/source/net/filebot/MetaAttributeView.java @@ -17,7 +17,7 @@ import java.util.Set; import com.sun.jna.Platform; -import net.filebot.mac.MacXattrView; +import net.filebot.platform.mac.MacXattrView; public class MetaAttributeView extends AbstractMap { diff --git a/source/net/filebot/UserFiles.java b/source/net/filebot/UserFiles.java index ffe563f0..4af13e85 100644 --- a/source/net/filebot/UserFiles.java +++ b/source/net/filebot/UserFiles.java @@ -27,7 +27,7 @@ import javax.swing.JFileChooser; import com.apple.eio.FileManager; import com.sun.jna.platform.FileUtils; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.util.FileUtilities; import net.filebot.util.FileUtilities.ExtensionFileFilter; diff --git a/source/net/filebot/format/ExpressionFormatFunctions.java b/source/net/filebot/format/ExpressionFormatFunctions.java index 0a0f529f..333c4fa3 100644 --- a/source/net/filebot/format/ExpressionFormatFunctions.java +++ b/source/net/filebot/format/ExpressionFormatFunctions.java @@ -19,7 +19,7 @@ import com.sun.jna.Platform; import groovy.lang.Closure; import groovy.util.XmlSlurper; import net.filebot.ApplicationFolder; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.util.FileUtilities; /** diff --git a/source/net/filebot/gio/GVFS.java b/source/net/filebot/platform/gnome/GVFS.java similarity index 92% rename from source/net/filebot/gio/GVFS.java rename to source/net/filebot/platform/gnome/GVFS.java index b31a9e50..7f3d0d62 100644 --- a/source/net/filebot/gio/GVFS.java +++ b/source/net/filebot/platform/gnome/GVFS.java @@ -1,4 +1,4 @@ -package net.filebot.gio; +package net.filebot.platform.gnome; import java.io.File; import java.net.URI; diff --git a/source/net/filebot/gio/LibGIO.java b/source/net/filebot/platform/gnome/LibGIO.java similarity index 90% rename from source/net/filebot/gio/LibGIO.java rename to source/net/filebot/platform/gnome/LibGIO.java index 93e7eb68..5b28a02a 100644 --- a/source/net/filebot/gio/LibGIO.java +++ b/source/net/filebot/platform/gnome/LibGIO.java @@ -1,5 +1,5 @@ -package net.filebot.gio; +package net.filebot.platform.gnome; import com.sun.jna.Library; import com.sun.jna.Pointer; diff --git a/source/net/filebot/gio/NativeGVFS.java b/source/net/filebot/platform/gnome/NativeGVFS.java similarity index 95% rename from source/net/filebot/gio/NativeGVFS.java rename to source/net/filebot/platform/gnome/NativeGVFS.java index 35a76166..4d296677 100644 --- a/source/net/filebot/gio/NativeGVFS.java +++ b/source/net/filebot/platform/gnome/NativeGVFS.java @@ -1,5 +1,5 @@ -package net.filebot.gio; +package net.filebot.platform.gnome; import java.io.File; import java.net.URI; diff --git a/source/net/filebot/gio/PlatformGVFS.java b/source/net/filebot/platform/gnome/PlatformGVFS.java similarity index 98% rename from source/net/filebot/gio/PlatformGVFS.java rename to source/net/filebot/platform/gnome/PlatformGVFS.java index 0401b05b..f50da760 100644 --- a/source/net/filebot/gio/PlatformGVFS.java +++ b/source/net/filebot/platform/gnome/PlatformGVFS.java @@ -1,5 +1,5 @@ -package net.filebot.gio; +package net.filebot.platform.gnome; import static java.util.Arrays.*; import static java.util.stream.Collectors.*; diff --git a/source/net/filebot/mac/DropToUnlock.java b/source/net/filebot/platform/mac/DropToUnlock.java similarity index 99% rename from source/net/filebot/mac/DropToUnlock.java rename to source/net/filebot/platform/mac/DropToUnlock.java index 2fa1e2bf..d0246425 100644 --- a/source/net/filebot/mac/DropToUnlock.java +++ b/source/net/filebot/platform/mac/DropToUnlock.java @@ -1,10 +1,10 @@ -package net.filebot.mac; +package net.filebot.platform.mac; import static java.util.Collections.*; import static javax.swing.BorderFactory.*; import static net.filebot.Logging.*; import static net.filebot.UserFiles.*; -import static net.filebot.mac.MacAppUtilities.*; +import static net.filebot.platform.mac.MacAppUtilities.*; import static net.filebot.util.FileUtilities.*; import static net.filebot.util.ui.SwingUI.*; diff --git a/source/net/filebot/mac/MacAppUtilities.java b/source/net/filebot/platform/mac/MacAppUtilities.java similarity index 99% rename from source/net/filebot/mac/MacAppUtilities.java rename to source/net/filebot/platform/mac/MacAppUtilities.java index 4c750cc3..553c26a3 100644 --- a/source/net/filebot/mac/MacAppUtilities.java +++ b/source/net/filebot/platform/mac/MacAppUtilities.java @@ -1,4 +1,4 @@ -package net.filebot.mac; +package net.filebot.platform.mac; import static ca.weblite.objc.util.CocoaUtils.*; import static net.filebot.Logging.*; diff --git a/source/net/filebot/mac/MacXattrView.java b/source/net/filebot/platform/mac/MacXattrView.java similarity index 95% rename from source/net/filebot/mac/MacXattrView.java rename to source/net/filebot/platform/mac/MacXattrView.java index 8e82e8e4..396e85be 100644 --- a/source/net/filebot/mac/MacXattrView.java +++ b/source/net/filebot/platform/mac/MacXattrView.java @@ -1,4 +1,4 @@ -package net.filebot.mac; +package net.filebot.platform.mac; import java.nio.file.Path; import java.text.Normalizer; diff --git a/source/net/filebot/win/WinAppUtilities.java b/source/net/filebot/platform/windows/WinAppUtilities.java similarity index 96% rename from source/net/filebot/win/WinAppUtilities.java rename to source/net/filebot/platform/windows/WinAppUtilities.java index 238465f6..819272a2 100644 --- a/source/net/filebot/win/WinAppUtilities.java +++ b/source/net/filebot/platform/windows/WinAppUtilities.java @@ -1,4 +1,4 @@ -package net.filebot.win; +package net.filebot.platform.windows; import static net.filebot.Logging.*; diff --git a/source/net/filebot/ui/MainFrame.java b/source/net/filebot/ui/MainFrame.java index e32fecef..f5b870e8 100644 --- a/source/net/filebot/ui/MainFrame.java +++ b/source/net/filebot/ui/MainFrame.java @@ -37,7 +37,7 @@ import com.google.common.eventbus.Subscribe; import net.filebot.CacheManager; import net.filebot.Settings; import net.filebot.cli.GroovyPad; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.util.PreferencesMap.PreferencesEntry; import net.filebot.util.ui.DefaultFancyListCellRenderer; import net.filebot.util.ui.ShadowBorder; diff --git a/source/net/filebot/ui/filter/FileTreeTransferablePolicy.java b/source/net/filebot/ui/filter/FileTreeTransferablePolicy.java index fbe4dc39..247b2562 100644 --- a/source/net/filebot/ui/filter/FileTreeTransferablePolicy.java +++ b/source/net/filebot/ui/filter/FileTreeTransferablePolicy.java @@ -15,7 +15,7 @@ import java.util.logging.Level; import javax.swing.tree.TreeNode; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.ui.filter.FileTree.FileNode; import net.filebot.ui.filter.FileTree.FolderNode; import net.filebot.ui.transfer.BackgroundFileTransferablePolicy; diff --git a/source/net/filebot/ui/rename/FormatDialog.java b/source/net/filebot/ui/rename/FormatDialog.java index df20cb5e..17633953 100644 --- a/source/net/filebot/ui/rename/FormatDialog.java +++ b/source/net/filebot/ui/rename/FormatDialog.java @@ -65,8 +65,8 @@ import net.filebot.format.ExpressionFileFormat; import net.filebot.format.ExpressionFormat; import net.filebot.format.MediaBindingBean; import net.filebot.format.SuppressedThrowables; -import net.filebot.mac.MacAppUtilities; import net.filebot.media.MetaAttributes; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.util.DefaultThreadFactory; import net.filebot.util.PreferencesList; import net.filebot.util.PreferencesMap.PreferencesEntry; diff --git a/source/net/filebot/ui/rename/HistoryDialog.java b/source/net/filebot/ui/rename/HistoryDialog.java index 01520cf1..e2f893ec 100644 --- a/source/net/filebot/ui/rename/HistoryDialog.java +++ b/source/net/filebot/ui/rename/HistoryDialog.java @@ -72,10 +72,10 @@ import javax.swing.table.TableRowSorter; import net.filebot.History; import net.filebot.History.Element; import net.filebot.History.Sequence; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.HistorySpooler; import net.filebot.ResourceManager; import net.filebot.StandardRenameAction; -import net.filebot.mac.MacAppUtilities; import net.filebot.ui.transfer.FileExportHandler; import net.filebot.ui.transfer.FileTransferablePolicy; import net.filebot.ui.transfer.LoadAction; diff --git a/source/net/filebot/ui/rename/PresetEditor.java b/source/net/filebot/ui/rename/PresetEditor.java index 11b5ef23..4bb1db39 100644 --- a/source/net/filebot/ui/rename/PresetEditor.java +++ b/source/net/filebot/ui/rename/PresetEditor.java @@ -40,7 +40,7 @@ import net.filebot.WebServices; import net.filebot.format.ExpressionFileFormat; import net.filebot.format.ExpressionFilter; import net.filebot.format.MediaBindingBean; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.ui.HeaderPanel; import net.filebot.util.FileUtilities.ExtensionFileFilter; import net.filebot.web.Datasource; diff --git a/source/net/filebot/ui/rename/RenameAction.java b/source/net/filebot/ui/rename/RenameAction.java index a8cdf3c2..31d2cf8b 100644 --- a/source/net/filebot/ui/rename/RenameAction.java +++ b/source/net/filebot/ui/rename/RenameAction.java @@ -36,7 +36,7 @@ import net.filebot.NativeRenameAction; import net.filebot.ResourceManager; import net.filebot.StandardRenameAction; import net.filebot.UserFiles; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.similarity.Match; import net.filebot.util.ui.ProgressMonitor; import net.filebot.util.ui.ProgressMonitor.ProgressWorker; diff --git a/source/net/filebot/ui/rename/RenamePanel.java b/source/net/filebot/ui/rename/RenamePanel.java index 6f19f295..9025d35e 100644 --- a/source/net/filebot/ui/rename/RenamePanel.java +++ b/source/net/filebot/ui/rename/RenamePanel.java @@ -68,8 +68,8 @@ import net.filebot.UserFiles; import net.filebot.WebServices; import net.filebot.format.ExpressionFileFormat; import net.filebot.format.MediaBindingBean; -import net.filebot.mac.MacAppUtilities; import net.filebot.media.MetaAttributes; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.similarity.Match; import net.filebot.ui.SelectDialog; import net.filebot.ui.rename.FormatDialog.Mode; diff --git a/source/net/filebot/ui/sfv/ChecksumTableTransferablePolicy.java b/source/net/filebot/ui/sfv/ChecksumTableTransferablePolicy.java index a2255519..9eef2c14 100644 --- a/source/net/filebot/ui/sfv/ChecksumTableTransferablePolicy.java +++ b/source/net/filebot/ui/sfv/ChecksumTableTransferablePolicy.java @@ -21,7 +21,7 @@ import java.util.logging.Level; import net.filebot.hash.HashType; import net.filebot.hash.VerificationFileReader; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.ui.transfer.BackgroundFileTransferablePolicy; import net.filebot.util.ExceptionUtilities; import net.filebot.util.FileSet; diff --git a/source/net/filebot/ui/subtitle/SubtitleAutoMatchDialog.java b/source/net/filebot/ui/subtitle/SubtitleAutoMatchDialog.java index e4f262bd..a5bf2a6f 100644 --- a/source/net/filebot/ui/subtitle/SubtitleAutoMatchDialog.java +++ b/source/net/filebot/ui/subtitle/SubtitleAutoMatchDialog.java @@ -62,7 +62,7 @@ import javax.swing.table.DefaultTableCellRenderer; import net.filebot.ResourceManager; import net.filebot.WebServices; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.subtitle.SubtitleMetrics; import net.filebot.subtitle.SubtitleNaming; import net.filebot.util.ui.AbstractBean; diff --git a/source/net/filebot/ui/subtitle/SubtitleDropTarget.java b/source/net/filebot/ui/subtitle/SubtitleDropTarget.java index f783baf6..1c3f91e2 100644 --- a/source/net/filebot/ui/subtitle/SubtitleDropTarget.java +++ b/source/net/filebot/ui/subtitle/SubtitleDropTarget.java @@ -34,7 +34,7 @@ import javax.swing.JDialog; import javax.swing.SwingUtilities; import net.filebot.ResourceManager; -import net.filebot.mac.MacAppUtilities; +import net.filebot.platform.mac.MacAppUtilities; import net.filebot.ui.subtitle.upload.SubtitleUploadDialog; import net.filebot.util.FileUtilities; import net.filebot.util.FileUtilities.ParentFilter; diff --git a/source/net/filebot/ui/transfer/FileTransferable.java b/source/net/filebot/ui/transfer/FileTransferable.java index f9839043..9ff69169 100644 --- a/source/net/filebot/ui/transfer/FileTransferable.java +++ b/source/net/filebot/ui/transfer/FileTransferable.java @@ -17,7 +17,7 @@ import java.util.Collection; import java.util.List; import java.util.Scanner; -import net.filebot.gio.GVFS; +import net.filebot.platform.gnome.GVFS; public class FileTransferable implements Transferable { diff --git a/test/net/filebot/gio/PlatformGVFSTest.java b/test/net/filebot/gio/PlatformGVFSTest.java index cc056bc3..582e1efc 100644 --- a/test/net/filebot/gio/PlatformGVFSTest.java +++ b/test/net/filebot/gio/PlatformGVFSTest.java @@ -7,6 +7,9 @@ import java.net.URI; import org.junit.Test; +import net.filebot.platform.gnome.GVFS; +import net.filebot.platform.gnome.PlatformGVFS; + public class PlatformGVFSTest { GVFS gvfs = new PlatformGVFS(new File("gvfs")); diff --git a/test/net/filebot/web/TMDbClientTest.java b/test/net/filebot/web/TMDbClientTest.java index 6ede53b0..78ae12be 100644 --- a/test/net/filebot/web/TMDbClientTest.java +++ b/test/net/filebot/web/TMDbClientTest.java @@ -6,7 +6,6 @@ import static org.junit.Assert.*; import java.net.URL; import java.time.Duration; import java.time.LocalDate; -import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.Map;