Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

FederationClientLauncher.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright 2011 gitblit.com.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.gitblit;
  17. import java.io.File;
  18. import java.io.IOException;
  19. import java.util.Collections;
  20. import java.util.List;
  21. import com.gitblit.build.Build;
  22. /**
  23. * Downloads dependencies and launches command-line Federation client.
  24. *
  25. * @author James Moger
  26. *
  27. */
  28. public class FederationClientLauncher {
  29. public static void main(String[] args) {
  30. // download federation client runtime dependencies
  31. Build.federationClient();
  32. File libFolder = new File("ext");
  33. List<File> jars = Launcher.findJars(libFolder.getAbsoluteFile());
  34. // sort the jars by name and then reverse the order so the newer version
  35. // of the library gets loaded in the event that this is an upgrade
  36. Collections.sort(jars);
  37. Collections.reverse(jars);
  38. for (File jar : jars) {
  39. try {
  40. Launcher.addJarFile(jar);
  41. } catch (IOException e) {
  42. }
  43. }
  44. FederationClient.main(args);
  45. }
  46. }