Skip to content

Commit 4288c8a

Browse files
committed
SSS-376 SSS-379
1 parent c2114b5 commit 4288c8a

File tree

3 files changed

+32
-29
lines changed

3 files changed

+32
-29
lines changed

adapter/adapter.rest/adapter.rest.v2/nb-configuration.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ Any value defined here will override the pom.xml file value but is only applicab
1717
<org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
1818
<netbeans.hint.jdkPlatform>JDK_1.8</netbeans.hint.jdkPlatform>
1919
<netbeans.compile.on.save>none</netbeans.compile.on.save>
20+
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>Tomcat</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
2021
</properties>
2122
</project-shared-configuration>

serv/serv.util/src/main/java/at/tugraz/sss/serv/SSFileExtE.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ public static boolean isAudioOrVideoFileExt(final SSFileExtE fileExt){
129129
return false;
130130
}
131131

132+
public static boolean isImageFileExt(final SSFileExtE fileExt){
133+
return SSStrU.contains(imageFileExts, fileExt);
134+
}
135+
132136
public static SSFileExtE ext(final String fileName) throws Exception {
133137

134138
try{

servs/dataimport/dataimport.impl/src/main/java/at/kc/tugraz/ss/serv/dataimport/impl/bitsandpieces/SSDataImportBitsAndPiecesEvernoteImporter.java

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
import at.kc.tugraz.ss.service.userevent.datatypes.pars.SSUEAddPar;
4949
import at.kc.tugraz.ss.service.userevent.datatypes.pars.SSUEsGetPar;
5050
import at.tugraz.sss.serv.SSEntity;
51+
import at.tugraz.sss.serv.SSFileExtE;
5152
import at.tugraz.sss.serv.SSLogU;
53+
import at.tugraz.sss.serv.SSMimeTypeE;
5254
import at.tugraz.sss.serv.SSServErrReg;
5355
import at.tugraz.sss.serv.SSServReg;
5456
import com.evernote.edam.type.LinkedNotebook;
@@ -670,30 +672,31 @@ private void handleResources() throws Exception{
670672

671673
resourceWithContent = SSServCaller.evernoteResourceGet (evernoteInfo.noteStore, resource.getGuid(), false);
672674

673-
// if(resourceWithContent.getAttributes().isSetSourceURL()){
674-
// SSLogU.info(resourceWithContent.getAttributes().getSourceURL());
675-
// continue;
676-
// }
677-
//
678-
// if(
679-
// !resourceWithContent.isSetHeight() ||
680-
// !resourceWithContent.isSetWidth()){
681-
//
682-
// SSLogU.info("evernote resource height or width not set");
683-
// continue;
684-
// }
685-
686-
if(
687-
resourceWithContent.isSetHeight() &&
688-
resourceWithContent.isSetWidth()){
689-
690-
if(
691-
resourceWithContent.getWidth() <= 250||
692-
resourceWithContent.getHeight() <= 250){
693-
694-
SSLogU.info("evernote resource height or width < 250");
695-
continue;
696-
}
675+
try{
676+
if(SSFileExtE.isImageFileExt(SSMimeTypeE.fileExtForMimeType1(resourceWithContent.getMime()))){
677+
678+
if(resourceWithContent.getAttributes().isSetSourceURL()){
679+
SSLogU.info("evernote image with source url ignored: " + resourceWithContent.getAttributes().getSourceURL());
680+
continue;
681+
}
682+
683+
if(
684+
!resourceWithContent.isSetHeight() ||
685+
!resourceWithContent.isSetWidth()){
686+
687+
SSLogU.info("evernote image resource height or width not set");
688+
continue;
689+
}
690+
691+
if(
692+
resourceWithContent.getWidth() <= 250||
693+
resourceWithContent.getHeight() <= 250){
694+
695+
SSLogU.info("evernote image resource height or width < 250");
696+
continue;
697+
}
698+
}
699+
}catch(Exception error){
697700
}
698701

699702
resourceWithContent = SSServCaller.evernoteResourceGet (evernoteInfo.noteStore, resource.getGuid(), true);
@@ -909,11 +912,6 @@ private Boolean addCurrentlyRunEvernoteImport(
909912

910913
try{
911914

912-
if(currentlyRunEvernoteImportsLock.isWriteLocked()){
913-
SSLogU.warn("attempted to start B&P evernote import concurrently for " + authEmail);
914-
return false;
915-
}
916-
917915
if(!currentlyRunEvernoteImportsLock.isWriteLockedByCurrentThread()){
918916
currentlyRunEvernoteImportsLock.writeLock().lock();
919917
}

0 commit comments

Comments
 (0)