Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Dehm
briar
Commits
5c78b480
Commit
5c78b480
authored
11 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Use new IOException(String) for consistency with other calls.
parent
52b29b16
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-desktop/src/org/briarproject/plugins/file/UnixRemovableDriveMonitor.java
+7
-13
7 additions, 13 deletions
.../briarproject/plugins/file/UnixRemovableDriveMonitor.java
with
7 additions
and
13 deletions
briar-desktop/src/org/briarproject/plugins/file/UnixRemovableDriveMonitor.java
+
7
−
13
View file @
5c78b480
...
...
@@ -11,6 +11,9 @@ import net.contentobjects.jnotify.JNotifyListener;
abstract
class
UnixRemovableDriveMonitor
implements
RemovableDriveMonitor
,
JNotifyListener
{
private
static
boolean
triedLoad
=
false
;
// Locking: class
private
static
Throwable
loadError
=
null
;
// Locking: class
// Locking: this
private
final
List
<
Integer
>
watches
=
new
ArrayList
<
Integer
>();
...
...
@@ -19,32 +22,23 @@ JNotifyListener {
protected
abstract
String
[]
getPathsToWatch
();
private
static
boolean
triedLoad
=
false
;
private
static
Throwable
loadError
=
null
;
private
static
Throwable
tryLoad
()
{
try
{
Class
.
forName
(
"net.contentobjects.jnotify.JNotify"
);
return
null
;
}
catch
(
UnsatisfiedLinkError
e
)
{
}
catch
(
UnsatisfiedLinkError
e
)
{
return
e
;
}
catch
(
ClassNotFoundException
e
)
{
}
catch
(
ClassNotFoundException
e
)
{
return
e
;
}
}
public
static
synchronized
void
checkEnabled
()
throws
IOException
{
if
(!
triedLoad
)
{
if
(!
triedLoad
)
{
loadError
=
tryLoad
();
triedLoad
=
true
;
}
if
(
loadError
!=
null
)
{
// gymnastics due to having to support earlier Android APIs
// TODO(infinity0): add a utility that does this and convert other exceptions too
IOException
e
=
new
IOException
(
"JNotify not loaded"
);
e
.
initCause
(
loadError
);
throw
e
;
}
if
(
loadError
!=
null
)
throw
new
IOException
(
loadError
.
toString
());
}
public
void
start
(
Callback
callback
)
throws
IOException
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment