Skip to content

New UI #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 143 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from 139 commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
9757fdb
Upgrade to Java 17
Ashuh Dec 17, 2023
efe9e17
Add atlantafx & ikonli libraries
Ashuh Dec 17, 2023
2e496ab
Replace existing icons with ikonli icons & remove toolbar separators
Ashuh Dec 17, 2023
53bd367
Replace VBox with SplitPane in MainWindow
Ashuh Dec 17, 2023
6e1ecb7
Remove unnecessary wrapping of views with StackPane
Ashuh Dec 21, 2023
3ace621
Implement formatting for displayed data sizes
Ashuh Dec 22, 2023
645a8a3
Make Sha1Hash.of() thread-safe
Ashuh Dec 26, 2023
f00a905
Fix conversion from epoch seconds to LocalDateTime
Ashuh Dec 26, 2023
442b0b7
Remove automatic starting of torrents when added
Ashuh Dec 26, 2023
2642d68
Add TorrentInfoView
Ashuh Dec 27, 2023
1028dfe
Refactor logic for checking file byte offsets
Ashuh Dec 28, 2023
582eb95
Fix verified bytes going negative
Ashuh Dec 28, 2023
2226c0d
Remove RangeList
Ashuh Dec 28, 2023
0ecbf5b
Fix DataStatusBar update bug
Ashuh Dec 28, 2023
7883620
Add FilesView
Ashuh Dec 29, 2023
1b722ed
Set torrent to active before verifying files
Ashuh Dec 29, 2023
2979c11
Extract file related logic in Torrent into FileWithInfoList
Ashuh Dec 29, 2023
22f6ddb
Change return type from int to long for getVerifiedBytes()
Ashuh Dec 29, 2023
dd59ec1
Reimplement DataStatusBar using ImageView
Ashuh Dec 30, 2023
20d513a
Fix column text
Ashuh Dec 30, 2023
cbefc56
Add binding for overall downloaded percentage
Ashuh Dec 30, 2023
036117e
Refactor TorrentsTableView
Ashuh Dec 30, 2023
93dd40d
Add save directory feature (hardcoded for now)
Ashuh Dec 30, 2023
8f97be0
Add open file explorer on double click feature
Ashuh Dec 30, 2023
9b67363
Add save directory column in TorrentsTableView
Ashuh Dec 30, 2023
b62960f
Implement manual adding of peers feature
Ashuh Dec 31, 2023
e881a81
Implement add torrent from file feature
Ashuh Dec 31, 2023
6932a96
Add check for duplicate torrents
Ashuh Dec 31, 2023
34edad0
Uniquely identify torrents using info hash
Ashuh Dec 31, 2023
5091762
Implement options dialog for adding new torrent from file
Ashuh Jan 1, 2024
2e4f288
Refactor adding torrent from file logic
Ashuh Jan 1, 2024
9cc488a
Fix bug when computing number of pieces in file
Ashuh Jan 2, 2024
167a154
Implement adding new torrent via menu bar
Ashuh Jan 3, 2024
9276e5b
Prevent clicking outside of file chooser
Ashuh Jan 4, 2024
fa5fd73
Refactor logic related to add new torrent dialog
Ashuh Jan 5, 2024
6070293
Save multi file torrents in a sub folder
Ashuh Jan 5, 2024
d2be105
Fix bug when computing file info
Ashuh Jan 6, 2024
ffe8e7a
Create missing directories before reading and writing
Ashuh Jan 6, 2024
52f3901
Return copy of BitSet
Ashuh Jan 6, 2024
e3c87c0
Add missing minus sign
Ashuh Jan 6, 2024
dcce6ff
Fix DataStatusBar not updating correctly when setting piece missing
Ashuh Jan 6, 2024
fcdf6c9
Refactor logic related to representing file information
Ashuh Jan 6, 2024
868dd3f
Set block not requested when block is not stored successfully
Ashuh Jan 6, 2024
fc52cb7
Refactor getRootSaveDirectory()
Ashuh Jan 6, 2024
41b2956
Add check to ensure that file in SingleFileInfo has no directories
Ashuh Jan 7, 2024
401d3f5
Display file or directory that torrent contents are being saved to
Ashuh Jan 7, 2024
de58db2
Open file explorer using save as path instead of save directory
Ashuh Jan 7, 2024
625311e
Implement formatting for remaining time
Ashuh Jan 7, 2024
7d4122e
Dispose disposables when UiTorrent is removed
Ashuh Jan 7, 2024
9b1f566
Make CalculateEtaCombiner public
Ashuh Jan 8, 2024
3749924
Fix compile error in BencodedTorrentTest
Ashuh Jan 8, 2024
7a6848a
Rearrange package structure
Ashuh Jan 9, 2024
e876642
Fix DataStatusBar blurry image when stretched
Ashuh Jan 13, 2024
efcd272
Fix infinity symbol not being displayed correctly
Ashuh Jan 13, 2024
df36c26
Refactor adding new torrent logic
Ashuh Jan 13, 2024
66d9d48
Add JTorrentFxmlLoader
Ashuh Jan 13, 2024
5ac5407
Move PeerMessageUnpacker into factory package
Ashuh Jan 13, 2024
b57890d
Fix BencodedTorrentTest
Ashuh Jan 13, 2024
1af266a
Set dialog owner
Ashuh Jan 14, 2024
4b0bae4
Implement add torrent from url feature
Ashuh Jan 14, 2024
28fe30a
Remove unused menu items
Ashuh Jan 14, 2024
89ada51
Add MenuItem accelerators
Ashuh Jan 14, 2024
01cd31a
Exit application when quit MenuItem is selected
Ashuh Jan 14, 2024
8758c48
Add styling for DataStatusBar colors via css
Ashuh Jan 15, 2024
1ac637c
Change DataStatusBar parent from Pane to Region
Ashuh Jan 15, 2024
14886ad
Add themes
Ashuh Jan 20, 2024
6c97da3
Add custom dialog for peer input
Ashuh Jan 20, 2024
767b335
Fix jul.properties path
Ashuh Jan 21, 2024
f514c94
Display peer port in table
Ashuh Jan 21, 2024
220f1d0
Add null check
Ashuh Jan 21, 2024
4b337eb
Format peer download and upload rates
Ashuh Jan 21, 2024
1ef8dad
Remove PeerHandler from Set on disconnect
Ashuh Jan 21, 2024
04c05dc
Dispose UiPeers no longer in use
Ashuh Jan 21, 2024
0d5ee0b
Add placeholder dialog for creation of new torrent
Ashuh Feb 3, 2024
d867626
Rename variable
Ashuh Feb 3, 2024
81b7bf8
Rename AddNewTorrentDialog.fxml to AddNewTorrentView.fxml
Ashuh Feb 3, 2024
328a325
Update AddNewTorrentView spacing
Ashuh Feb 3, 2024
6c232cb
Move torrent controls into separate class
Ashuh Feb 3, 2024
5c02940
Fix source not being removed when peer is removed from Torrent
Ashuh Feb 25, 2024
6ee0460
Remove print statement
Ashuh Feb 25, 2024
2273d2c
Add ChartView
Ashuh Feb 25, 2024
03629e8
Refactor data size formatting
Ashuh Feb 25, 2024
6bd4677
Fix progress calculation
Ashuh Feb 26, 2024
6714639
Implement torrent state display
Ashuh Feb 29, 2024
18cee66
Set subscription to null after dispose
Ashuh Mar 2, 2024
ef29a41
Refactor TorrentControlsView binding
Ashuh Mar 2, 2024
2283b29
Refactor views
Ashuh Mar 5, 2024
f9bd50a
Finalize method
Ashuh Mar 6, 2024
f330732
Refactor TorrentInfoView binding
Ashuh Mar 7, 2024
2fcf451
Implement handling for add torrent url button
Ashuh Mar 7, 2024
9968029
Implement handling for remove torrent button
Ashuh Mar 7, 2024
ef8c169
Clear torrent table selection if an empty row is clicked
Ashuh Mar 7, 2024
6e6a2c4
Make DataStatusBar invisible if invalid number of segments is set
Ashuh Mar 8, 2024
a4116d0
Fix downloaded/availability bars resizing when progress increases
Ashuh Mar 8, 2024
57b7a29
Change TorrentsTableView column widths
Ashuh Mar 8, 2024
1729952
Add javadoc
Ashuh Mar 10, 2024
81361b5
Implement logic for creating new .torrent files
Ashuh Mar 10, 2024
a436b79
Delete UiNewTorrent
Ashuh Mar 10, 2024
ef5acbc
Delete UiComponent
Ashuh Mar 12, 2024
b0e71f9
Add TorrentsTableViewModel
Ashuh Mar 12, 2024
bf87330
Add PeersTableViewModel
Ashuh Mar 12, 2024
ee10a3c
Add TorrentControlsViewModel
Ashuh Mar 14, 2024
fafb343
Move reusable components into component package
Ashuh Mar 14, 2024
094c8c7
Add TorrentInfoViewModel
Ashuh Mar 15, 2024
2f036a1
Add FileInfoViewModel
Ashuh Mar 15, 2024
5ba7a62
Add ChartViewModel
Ashuh Mar 15, 2024
c5ee4c8
Rename MainWindow to MainView
Ashuh Mar 15, 2024
ab7962b
Remove unused fields
Ashuh Mar 15, 2024
e8ea377
Make UiTorrentStatus inner class of TorrentStatusCell
Ashuh Mar 15, 2024
be04235
Rename FilesView to FileInfoView
Ashuh Mar 16, 2024
254ba46
Rename MainWindow.fxml to MainView.fxml
Ashuh Mar 16, 2024
3818514
Organize presentation layer packages
Ashuh Mar 16, 2024
4a9997d
Extract ExceptionAlert expandable content into separate class
Ashuh Mar 16, 2024
b31d40b
Refactor add new torrent logic
Ashuh Mar 17, 2024
0944e63
Refactor file tree building
Ashuh Mar 17, 2024
49d4b94
Refactor getters and setters
Ashuh Mar 17, 2024
0ee2ebf
Update peers list on JavaFX Application Thread
Ashuh Mar 17, 2024
653083c
Dispose peers when removed
Ashuh Mar 17, 2024
b90fddc
Clear peerToUiPeer map when clear event is received
Ashuh Mar 17, 2024
388dd3f
Fix TorrentsTableViewModel torrents subscription logic
Ashuh Mar 17, 2024
8485271
Replace Observable in CombinedObservable with BehaviourSubject
Ashuh Mar 17, 2024
08af522
Remove redundant computations in DataStatusBar updateAvailability()
Ashuh Mar 17, 2024
2db7d64
Fix bug when deleting torrents
Ashuh Mar 18, 2024
93903fa
Remove unused methods
Ashuh Mar 20, 2024
4c14f2c
Disable peers table context menu if no torrent is selected
Ashuh Mar 20, 2024
587ffcd
Refactor torrent domain models
Ashuh Mar 23, 2024
0c7200a
Return TorrentMetadata from repository instead of BencodedTorrent
Ashuh Mar 24, 2024
af29b38
Fix bug when creating BencodedMultiFileInfo
Ashuh Mar 25, 2024
c7c01db
Remove usage of BencodedTorrent in domain & presentation layers
Ashuh Mar 26, 2024
2a513ce
Refactor creation of BencodedTorrent when creating new torrent file
Ashuh Mar 27, 2024
eb7b318
Remove unused class
Ashuh Mar 27, 2024
b8b8df5
Move infoHash field from TorrentMetadata to FileInfo
Ashuh Mar 29, 2024
f966ed8
Increment torrent uploaded when sending requested blocks
Ashuh Mar 30, 2024
0ec34e5
Remove test code
Ashuh Mar 30, 2024
8e49b3e
Simplify peer input ui & refactor code
Ashuh Mar 30, 2024
9f1baee
Add validation check in PeerContactInfo constructor
Ashuh Mar 31, 2024
73f4e4f
Increase request timeout
Ashuh Mar 31, 2024
dbcff8d
Edit log
Ashuh Mar 31, 2024
1963b81
Replace int with long for downloaded/uploaded amount
Ashuh Mar 31, 2024
bd85085
Update GitHub action checkout to java 17
Ashuh Mar 31, 2024
8e33bd9
Fix import order
Ashuh Mar 31, 2024
7d3a611
Remove unused import
Ashuh Mar 31, 2024
fd23fda
Fix indentation
Ashuh Mar 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ plugins {
group 'jtorrent'
version '1.0-SNAPSHOT'

sourceCompatibility = '11'
targetCompatibility = '11'
sourceCompatibility = '17'
targetCompatibility = '17'

application {
mainModule = 'jtorrent'
mainClass = 'jtorrent.application.presentation.Main'
mainClass = 'jtorrent.Main'
}

repositories {
Expand All @@ -33,6 +33,9 @@ javafx {
dependencies {
implementation 'com.dampcake:bencode:1.4'
implementation 'io.reactivex.rxjava3:rxjava:3.1.6'
implementation 'io.github.mkpaz:atlantafx-base:2.0.1'
implementation 'org.kordamp.ikonli:ikonli-javafx:12.3.1'
implementation 'org.kordamp.ikonli:ikonli-materialdesign2-pack:12.3.1'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
257 changes: 153 additions & 104 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh

#
# Copyright 2015 the original author or authors.
# Copyright 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,67 +17,101 @@
#

##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions �$var�, �${var}�, �${var:-default}�, �${var+SET}�,
# �${var#prefix}�, �${var%suffix}�, and �$( cmd )�;
# * compound commands having a testable exit status, especially �case�;
# * various built-in commands including �command�, �set�, and �ulimit�.
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################

# Attempt to set APP_HOME

# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0

# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum

warn () {
echo "$*"
}
} >&2

die () {
echo
echo "$*"
echo
exit 1
}
} >&2

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
Expand All @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Expand All @@ -98,88 +132,103 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.

# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )

JAVACMD=$( cygpath --unix "$JAVACMD" )

# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
i=`expr $i + 1`
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'

exec "$JAVACMD" "$@"
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package jtorrent.application.presentation;
package jtorrent;

import java.io.IOException;
import java.io.InputStream;
import java.lang.System.Logger.Level;
import java.util.logging.LogManager;

import javafx.application.Application;
import jtorrent.presentation.JTorrent;

public class Main {

Expand Down
23 changes: 0 additions & 23 deletions src/main/java/jtorrent/application/presentation/UiManager.java

This file was deleted.

Loading