esoe 2 years ago
parent
commit
35fe51f722
  1. 5
      options-home.json
  2. 3
      options-office.json
  3. 1
      out/repos
  4. 45
      out/unzip/molokoin/molokoin-client/css/style.css
  5. 23
      out/unzip/molokoin/molokoin-client/index.html
  6. 1
      out/unzip/molokoin/molokoin-client/js/main.js
  7. BIN
      out/zip/molokoin-client-master.zip
  8. 66
      src/main/java/ru/molokoin/sourceListener/ListRemoteRepository.java
  9. 28
      src/main/java/ru/molokoin/sourceListener/Options.java
  10. 57
      src/main/java/ru/molokoin/sourceListener/RepoCrafter.java
  11. BIN
      target/classes/ru/molokoin/sourceListener/ListRemoteRepository.class
  12. BIN
      target/classes/ru/molokoin/sourceListener/Options.class
  13. BIN
      target/classes/ru/molokoin/sourceListener/RepoCrafter.class
  14. BIN
      target/classes/ru/molokoin/sourceListener/SourceListener.class

5
options-home.json

@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
{
"linkVC" : "http://molokoin.ru:3000/esoe/molokoin-client/archive/master.zip",
"zipLink" : "http://molokoin.ru:3000/esoe/molokoin-client/archive/master.zip",
"gitLink" : "http://molokoin.ru:3000/esoe/molokoin-client.git",
"gitLocalPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\repos",
"downloadPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\zip",
"zipPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\zip\\molokoin-client-master.zip",
"unzipPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\unzip\\molokoin"
}

3
options-office.json

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
{
"linkVC" : "http://molokoin.ru:3000/esoe/molokoin-client/archive/master.zip",
"zipLink" : "http://molokoin.ru:3000/esoe/molokoin-client/archive/master.zip",
"gitLink" : "http://molokoin.ru:3000/esoe/molokoin-client.git",
"downloadPath" : "C:\\Users\\devuser\\Documents\\code\\sourceListener\\out\\zip",
"zipPath" : "C:\\Users\\devuser\\Documents\\code\\sourceListener\\out\\zip\\molokoin-client-master.zip",
"unzipPath" : "C:\\Users\\devuser\\Documents\\code\\sourceListener\\out\\unzip\\molokoin"

1
out/repos

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 60eda0382753a60b183fec48f7372c956c7895ff

45
out/unzip/molokoin/molokoin-client/css/style.css

@ -1,45 +0,0 @@ @@ -1,45 +0,0 @@
body {
font-family: Arial;
padding: 20px;
background: #f1f1f1;
}
div {
background-color: rgb(181, 122, 236);
padding: 5px;
margin: 5px;
}
.header{
display: block;
padding: 30px;
font-size: 40px;
text-align: center;
background: rgb(181, 122, 236);
/*position: relative; top: 20px;*/
}
.controls{
/*position: relative; left: 20px;*/
list-style: none; /* Отключение отображения маркеров. */
width: 25%; /* Ширина меню. */
float: left;
/*padding-left: 20px;*/
}
.controls li {
margin: 5px; /* Отступ между блоками по высоте, необходимый для того чтобы пункты меню не сливались */
font-family: Verdana, Arial, Helvetica, sans-serif; /* Тип шрифта пунктов меню */
font-size: 14px; /* Размер текста меню */
}
.controls li a{
display: block; /* Изменение отображения на блочное для того, чтобы иметь возможность задать внутренние отступы. */
padding: 4px 15px; /* Отступы внутри блоков. */
background: #0db5b5; /* Цвет блоков меню. */
color: #3f3f3f; /* Цвет текста в блоках меню. */
text-decoration: none; /* Устранение подчёркивания ссылок. */
position: relative; /* Это необходимо при использовании Internet Explorer 6 для того, чтобы ссылка по всей своей площади была «кликабельной». */
}
.controls li a:hover {
background: #92d3d3; /* Цвет фона при наведении курсора мыши */
color: #6b6b6b; /* Цвет текста при наведении курсора мыши */
}
.mainframe{
background-color: aliceblue;
}

23
out/unzip/molokoin/molokoin-client/index.html

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>molokoin.ru</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="header">
molokoin.ru/ добавить картинку и кнопку авторизации
</div>
<div class="controls">
<li><a href="http://molokoin.ru:3000/esoe">gitea</a></li>
<li><a href="http://www.molokoin.ru:8080">apache</a></li>
<li><a href="http://www.egspt.ru">moodle</a></li>
<li><a href="http://isp12.adminvps.ru">adminvps</a></li>
</div>
<script src="js/main.js"></script>
</body>
</html>

1
out/unzip/molokoin/molokoin-client/js/main.js

@ -1 +0,0 @@ @@ -1 +0,0 @@
console.log("qu")

BIN
out/zip/molokoin-client-master.zip

Binary file not shown.

66
src/main/java/ru/molokoin/sourceListener/ListRemoteRepository.java

@ -1,66 +0,0 @@ @@ -1,66 +0,0 @@
package ru.molokoin.sourceListener;
/*
Copyright 2013, 2014 Dominik Stadler
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Ref;
import java.util.Collection;
import java.util.Map;
/**
* Simple snippet which shows how to list heads/tags of remote repositories without
* a local repository
*
* @author dominik.stadler at gmx.at
*/
public class ListRemoteRepository {
private static final String REMOTE_URL = "http://molokoin.ru:3000/esoe/sourceListener.git";
public static void main(String[] args) throws GitAPIException {
// then clone
System.out.println("Listing remote repository: " + REMOTE_URL);
Collection<Ref> refs = Git.lsRemoteRepository()
.setHeads(true)
.setTags(true)
.setRemote(REMOTE_URL)
.call();
for (Ref ref : refs) {
System.out.println("Ref>>>>>>>>: " + ref);
}
final Map<String, Ref> map = Git.lsRemoteRepository()
.setHeads(true)
.setTags(true)
.setRemote(REMOTE_URL)
.callAsMap();
System.out.println("As map");
for (Map.Entry<String, Ref> entry : map.entrySet()) {
System.out.println("Key: " + entry.getKey() + ", Ref: " + entry.getValue());
}
refs = Git.lsRemoteRepository()
.setRemote(REMOTE_URL)
.call();
System.out.println("All refs");
for (Ref ref : refs) {
System.out.println(">>>>>Ref: " + ref.getStorage().name() + ">>>>>" + ref.getName());
}
}
}

28
src/main/java/ru/molokoin/sourceListener/Options.java

@ -1,17 +1,31 @@ @@ -1,17 +1,31 @@
package ru.molokoin.sourceListener;
public class Options {
private String linkVC;
private String zipLink;
private String gitLink;
private String gitLocalPath;
private String downloadPath;
private String zipPath;
private String unzipPath;
public Options(){}
public void setLinkVC(String linkVC) {
this.linkVC = linkVC;
public void setZipLink(String zipLink) {
this.zipLink = zipLink;
}
public String getLinkVC() {
return linkVC;
public String getZipLink() {
return zipLink;
}
public void setGitLink(String gitLink) {
this.gitLink = gitLink;
}
public String getGitLink() {
return gitLink;
}
public void setGitLocalPath(String gitLocalPath) {
this.gitLocalPath = gitLocalPath;
}
public String getGitLocalPath() {
return gitLocalPath;
}
public void setDownloadPath(String downloadPath) {
this.downloadPath = downloadPath;
@ -33,7 +47,9 @@ public class Options { @@ -33,7 +47,9 @@ public class Options {
}
@Override
public String toString() {
String s = "linkVC : " + getLinkVC() + "\n";
String s = "zipLink : " + getZipLink() + "\n";
s = s + "gitLink : " + getGitLink() + "\n";
s = s + "gitLocalPath : " + getGitLocalPath() + "\n";
s = s + "downloadPath : " + getDownloadPath() + "\n";
s = s + "zipPath : " + getZipPath() + "\n";
s = s + "unzipPath : " + getUnzipPath() + "\n";

57
src/main/java/ru/molokoin/sourceListener/RepoCrafter.java

@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
package ru.molokoin.sourceListener;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.InvalidRemoteException;
import org.eclipse.jgit.api.errors.TransportException;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
import org.eclipse.jgit.util.FileUtils;
public class RepoCrafter {
public static Repository open() throws IOException {
FileRepositoryBuilder builder = new FileRepositoryBuilder();
return builder
.readEnvironment() // scan environment GIT_* variables
.findGitDir() // scan up the file system tree
.build();
}
public static Repository create() throws IOException {
// prepare a new folder
File localPath = File.createTempFile("TestGitRepository", "");
if(!localPath.delete()) {
throw new IOException("Could not delete temporary file " + localPath);
}
// create the directory
Repository repository = FileRepositoryBuilder.create(new File(localPath, ".git"));
repository.create();
return repository;
}
public static Repository copy(String gitLink, File localPath) throws IOException, InvalidRemoteException, TransportException, GitAPIException{
// prepare a new folder for the cloned repository
//File localPath = new File(locationPath);
if(!localPath.delete()) {
throw new IOException("Could not delete temporary file " + localPath);
}
// then clone
System.out.println("Cloning from " + gitLink + " to " + localPath);
Git result = Git.cloneRepository()
.setURI(gitLink)
.setDirectory(localPath)
//.setProgressMonitor(new SimpleProgressMonitor())
.call();
// Note: the call() returns an opened repository already which needs to be closed to avoid file handle leaks!
System.out.println("Having repository: " + result.getRepository().getDirectory());
return result.getRepository();
}
}

BIN
target/classes/ru/molokoin/sourceListener/ListRemoteRepository.class

Binary file not shown.

BIN
target/classes/ru/molokoin/sourceListener/Options.class

Binary file not shown.

BIN
target/classes/ru/molokoin/sourceListener/RepoCrafter.class

Binary file not shown.

BIN
target/classes/ru/molokoin/sourceListener/SourceListener.class

Binary file not shown.
Loading…
Cancel
Save