Skip to content

Commit 19b4e8c

Browse files
committed
Initial commit.
1 parent be01aad commit 19b4e8c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+6400
-2
lines changed

.github/ISSUE_TEMPLATE.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Checklist
2+
3+
Please review first that the issue is fully related with this SDK by checking the relevant checkboxes (`[x]`).
4+
5+
- [ ] I have a Modzy API Key active and have the entitlements to perform the desired action.
6+
- [ ] I review that have access to Modzy API host.
7+
- [ ] I think that is a error specific to the SDK.
8+
- [ ] I review the documentation and existing issues in order to not duplicate existing ones.
9+
- [ ] I am willing to follow-up on comments in a timely manner.
10+
11+
### Info
12+
13+
* Modzy SDK version:
14+
* Python version:
15+
* Operating System:
16+
17+
### Description
18+
19+
<!-- Describe what you were trying to get done. -->
20+
21+
### Steps to reproduce
22+
23+
<!-- You must include full steps to reproduce so that we can reproduce the problem. -->
24+
25+
```
26+
Paste the command(s) you ran and the output.
27+
```
28+
29+
**Expected results:** <!-- what you expected to happen? -->
30+
31+
**Actual results:** <!-- what did you see? -->
32+
33+
### Traceback
34+
35+
<details>
36+
<summary>Logs</summary>
37+
<!--
38+
Run to run your app by setting the logger level to DEBUG and attach all
39+
the output below between the lines with the backticks. Include exceptions
40+
and all trace info that can be useful.
41+
-->
42+
43+
```
44+
Paste the logs that you consider useful for diagnostic.
45+
```
46+
</details>

.github/PULL_REQUEST_TEMPLATE.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Description
2+
3+
<!-- Add a paragraph with a description of what tihs PR is doing, updating or removing. -->
4+
5+
## Related issues
6+
7+
<!-- Add a list of the issues related to this PR. -->
8+
9+
## Tests
10+
11+
<!-- Describe or reference for all changed/updated/fixed behaviors. -->
12+
13+
## Checklist
14+
15+
- [ ] I read the Contributing guide.
16+
- [ ] I update the documentation and if the case the README.md file.
17+
- [ ] I am willing to follow-up on review comments in a timely manner.

.gitignore

+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
.metadata
2+
bin/
3+
tmp/
4+
*.tmp
5+
*.bak
6+
*.swp
7+
*~.nib
8+
local.properties
9+
.settings/
10+
.idea/
11+
modzy-sdk.iml
12+
.loadpath
13+
.recommenders
14+
.env
15+
docs
16+
# External tool builders
17+
.externalToolBuilders/
18+
19+
# Locally stored "Eclipse launch configurations"
20+
*.launch
21+
22+
# PyDev specific (Python IDE for Eclipse)
23+
*.pydevproject
24+
25+
# CDT-specific (C/C++ Development Tooling)
26+
.cproject
27+
28+
# CDT- autotools
29+
.autotools
30+
31+
# Java annotation processor (APT)
32+
.factorypath
33+
34+
# PDT-specific (PHP Development Tools)
35+
.buildpath
36+
37+
# sbteclipse plugin
38+
.target
39+
40+
# Tern plugin
41+
.tern-project
42+
43+
# TeXlipse plugin
44+
.texlipse
45+
46+
# STS (Spring Tool Suite)
47+
.springBeans
48+
49+
# Code Recommenders
50+
.recommenders/
51+
52+
# Annotation Processing
53+
.apt_generated/
54+
55+
# Scala IDE specific (Scala & Java development for Eclipse)
56+
.cache-main
57+
.scala_dependencies
58+
.worksheet
59+
60+
### Eclipse Patch ###
61+
# Eclipse Core
62+
.project
63+
64+
# JDT-specific (Eclipse Java Development Tools)
65+
.classpath
66+
67+
# Annotation Processing
68+
.apt_generated
69+
70+
.sts4-cache/
71+
72+
### Git ###
73+
# Created by git for backups. To disable backups in Git:
74+
# $ git config --global mergetool.keepBackup false
75+
*.orig
76+
77+
# Created by git when using merge tools for conflicts
78+
*.BACKUP.*
79+
*.BASE.*
80+
*.LOCAL.*
81+
*.REMOTE.*
82+
*_BACKUP_*.txt
83+
*_BASE_*.txt
84+
*_LOCAL_*.txt
85+
*_REMOTE_*.txt
86+
87+
### Java ###
88+
# Compiled class file
89+
*.class
90+
91+
# Log file
92+
*.log
93+
94+
# BlueJ files
95+
*.ctxt
96+
97+
# Mobile Tools for Java (J2ME)
98+
.mtj.tmp/
99+
100+
# Package Files #
101+
*.jar
102+
*.war
103+
*.nar
104+
*.ear
105+
*.zip
106+
*.tar.gz
107+
*.rar
108+
109+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
110+
hs_err_pid*
111+
112+
### Maven ###
113+
target/
114+
pom.xml.tag
115+
pom.xml.releaseBackup
116+
pom.xml.versionsBackup
117+
pom.xml.next
118+
release.properties
119+
dependency-reduced-pom.xml
120+
buildNumber.properties
121+
.mvn/timing.properties
122+
.mvn/wrapper/maven-wrapper.jar
123+
.flattened-pom.xml
124+
125+
### Windows ###
126+
# Windows thumbnail cache files
127+
Thumbs.db
128+
Thumbs.db:encryptable
129+
ehthumbs.db
130+
ehthumbs_vista.db
131+
132+
# Dump file
133+
*.stackdump
134+
135+
# Folder config file
136+
[Dd]esktop.ini
137+
138+
# Recycle Bin used on file shares
139+
$RECYCLE.BIN/
140+
141+
# Windows Installer files
142+
*.cab
143+
*.msi
144+
*.msix
145+
*.msm
146+
*.msp
147+
148+
# Windows shortcuts
149+
*.lnk
+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
* Copyright 2007-present the original author or authors.
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+
import java.net.*;
17+
import java.io.*;
18+
import java.nio.channels.*;
19+
import java.util.Properties;
20+
21+
public class MavenWrapperDownloader {
22+
23+
private static final String WRAPPER_VERSION = "0.5.6";
24+
/**
25+
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26+
*/
27+
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28+
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29+
30+
/**
31+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32+
* use instead of the default one.
33+
*/
34+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35+
".mvn/wrapper/maven-wrapper.properties";
36+
37+
/**
38+
* Path where the maven-wrapper.jar will be saved to.
39+
*/
40+
private static final String MAVEN_WRAPPER_JAR_PATH =
41+
".mvn/wrapper/maven-wrapper.jar";
42+
43+
/**
44+
* Name of the property which should be used to override the default download url for the wrapper.
45+
*/
46+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47+
48+
public static void main(String args[]) {
49+
System.out.println("- Downloader started");
50+
File baseDirectory = new File(args[0]);
51+
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52+
53+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
54+
// wrapperUrl parameter.
55+
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56+
String url = DEFAULT_DOWNLOAD_URL;
57+
if(mavenWrapperPropertyFile.exists()) {
58+
FileInputStream mavenWrapperPropertyFileInputStream = null;
59+
try {
60+
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61+
Properties mavenWrapperProperties = new Properties();
62+
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63+
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64+
} catch (IOException e) {
65+
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66+
} finally {
67+
try {
68+
if(mavenWrapperPropertyFileInputStream != null) {
69+
mavenWrapperPropertyFileInputStream.close();
70+
}
71+
} catch (IOException e) {
72+
// Ignore ...
73+
}
74+
}
75+
}
76+
System.out.println("- Downloading from: " + url);
77+
78+
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79+
if(!outputFile.getParentFile().exists()) {
80+
if(!outputFile.getParentFile().mkdirs()) {
81+
System.out.println(
82+
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83+
}
84+
}
85+
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86+
try {
87+
downloadFileFromURL(url, outputFile);
88+
System.out.println("Done");
89+
System.exit(0);
90+
} catch (Throwable e) {
91+
System.out.println("- Error downloading");
92+
e.printStackTrace();
93+
System.exit(1);
94+
}
95+
}
96+
97+
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99+
String username = System.getenv("MVNW_USERNAME");
100+
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101+
Authenticator.setDefault(new Authenticator() {
102+
@Override
103+
protected PasswordAuthentication getPasswordAuthentication() {
104+
return new PasswordAuthentication(username, password);
105+
}
106+
});
107+
}
108+
URL website = new URL(urlString);
109+
ReadableByteChannel rbc;
110+
rbc = Channels.newChannel(website.openStream());
111+
FileOutputStream fos = new FileOutputStream(destination);
112+
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113+
fos.close();
114+
rbc.close();
115+
}
116+
117+
}

.mvn/wrapper/maven-wrapper.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

0 commit comments

Comments
 (0)