esoe
2 years ago
14 changed files with 85 additions and 144 deletions
@ -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" |
||||
|
||||
} |
@ -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; |
||||
} |
@ -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 +0,0 @@
@@ -1 +0,0 @@
|
||||
console.log("qu") |
Binary file not shown.
@ -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()); |
||||
} |
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue