proxy progress
This commit is contained in:
parent
0748e57ad9
commit
4e81034aeb
|
@ -55,6 +55,7 @@
|
|||
<src path="inifile/src/test/java"/>
|
||||
<src path="shared_ui/src"/>
|
||||
<src path="shared_io/src/main/java"/>
|
||||
<src path="shared_io/src/test/java"/>
|
||||
<src path="logging-api/src/main/java"/>
|
||||
<src path="ui/src/main/java"/>
|
||||
<src path="ui/src/test/java"/>
|
||||
|
|
|
@ -4,9 +4,14 @@
|
|||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="json-simple" level="project" />
|
||||
<orderEntry type="library" exported="" name="httpclient" level="project" />
|
||||
<orderEntry type="library" exported="" name="annotations" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="junit" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -0,0 +1,23 @@
|
|||
package com.rusefi;
|
||||
|
||||
public class SignatureHelper {
|
||||
|
||||
public static final String PREFIX = "rusEFI ";
|
||||
|
||||
static String getUrl(String signature) {
|
||||
if (!signature.startsWith(PREFIX))
|
||||
return null;
|
||||
signature = signature.substring(PREFIX.length()).trim();
|
||||
String[] elements = signature.split("\\.");
|
||||
if (elements.length != 5)
|
||||
return null;
|
||||
|
||||
String year = elements[0];
|
||||
String month = elements[1];
|
||||
String day = elements[2];
|
||||
String bundle = elements[3];
|
||||
String hash = elements[4];
|
||||
|
||||
return "https://rusefi.com/online/ini/rusefi/" + year + "/" + month + "/" + day + "/" + bundle + "/" + hash + ".ini";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.rusefi;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class SignatureHelperTest {
|
||||
@Test
|
||||
public void test() {
|
||||
String url = SignatureHelper.getUrl("rusEFI 2020.07.06.frankenso_na6.2468827536");
|
||||
assertEquals("https://rusefi.com/online/ini/rusefi/2020/07/06/frankenso_na6/2468827536.ini", url);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue