Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Code cleanup, beginning to impl token authorization
- Loading branch information
Showing
6 changed files
with
78 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
package org.fcrepo.auth.oauth.api; | ||
|
||
import static com.google.common.collect.ImmutableSet.copyOf; | ||
import static org.fcrepo.auth.oauth.Constants.OAUTH_WORKSPACE; | ||
|
||
import javax.jcr.RepositoryException; | ||
import javax.jcr.Session; | ||
|
||
import org.fcrepo.session.SessionFactory; | ||
|
||
public class Util { | ||
|
||
public static void | ||
createOauthWorkspace(final SessionFactory sessionFactory) | ||
throws RepositoryException { | ||
final Session session = sessionFactory.getSession(); | ||
try { | ||
if (!copyOf(session.getWorkspace().getAccessibleWorkspaceNames()) | ||
.contains(OAUTH_WORKSPACE)) { | ||
session.getWorkspace().createWorkspace(OAUTH_WORKSPACE); | ||
} | ||
} finally { | ||
session.logout(); | ||
} | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters