Skip to content

Commit

Permalink
Fixed commons-vfs sandbox module not compiling due to missing imports…
Browse files Browse the repository at this point in the history
… and libraries (#634)
  • Loading branch information
japplis authored Nov 21, 2024
1 parent bbfcda1 commit 819ee4b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
9 changes: 4 additions & 5 deletions commons-vfs2-sandbox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>jcifs</groupId>
<artifactId>jcifs</artifactId>
Expand Down Expand Up @@ -79,11 +83,6 @@
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
import org.apache.commons.logging.LogFactory;

import jakarta.mail.Address;
import jakarta.mail.Header;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.Part;
import jakarta.mail.internet.MimeMessage;

/**
Expand Down Expand Up @@ -136,19 +139,19 @@ private Map<String, Object> createMap() {
if (part instanceof MimeMessage) {
final MimeMessage message = (MimeMessage) part;
try {
final Address[] address = message.getRecipients(RecipientType.BCC);
final Address[] address = message.getRecipients(Message.RecipientType.BCC);
ret.put(OBJECT_PREFIX + "Recipients.BCC", address);
} catch (final MessagingException e) {
log.debug(e.getLocalizedMessage(), e);
}
try {
final Address[] address = message.getRecipients(RecipientType.CC);
final Address[] address = message.getRecipients(Message.RecipientType.CC);
ret.put(OBJECT_PREFIX + "Recipients.CC", address);
} catch (final MessagingException e) {
log.debug(e.getLocalizedMessage(), e);
}
try {
final Address[] address = message.getRecipients(RecipientType.TO);
final Address[] address = message.getRecipients(Message.RecipientType.TO);
ret.put(OBJECT_PREFIX + "Recipients.TO", address);
} catch (final MessagingException e) {
log.debug(e.getLocalizedMessage(), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.apache.commons.vfs2.impl.DefaultFileContentInfo;

import jakarta.mail.MessagingException;
import jakarta.mail.Part;
import jakarta.mail.internet.ContentType;

/**
* Gets access to the content info stuff for mime objects.
Expand All @@ -31,7 +33,7 @@ public class MimeFileContentInfoFactory implements FileContentInfoFactory {
@Override
public FileContentInfo create(final FileContent fileContent) throws FileSystemException {
final MimeFileObject mimeFile = (MimeFileObject) fileContent.getFile();
final Part part = mimeFile.getPart();
final Part part = (Part) mimeFile.getPart();

String contentTypeString = null;
String charset = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.commons.vfs2.provider.mime;

import jakarta.mail.Header;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
Expand All @@ -37,6 +38,7 @@
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.Multipart;
import jakarta.mail.Part;
import jakarta.mail.internet.MimeMultipart;

/**
Expand Down Expand Up @@ -64,7 +66,7 @@ protected void doAttach() throws Exception {
return;
}

setPart(((MimeFileSystem) getFileSystem()).createCommunicationLink());
setPart((Part) ((MimeFileSystem) getFileSystem()).createCommunicationLink());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.apache.commons.vfs2.util.SharedRandomContentInputStream;

import jakarta.mail.MessagingException;
import jakarta.mail.Part;
import jakarta.mail.internet.MimeMessage;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.io.InputStream;
import java.io.OutputStream;

import javax.activation.DataSource;
import jakarta.activation.DataSource;

import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
Expand Down

0 comments on commit 819ee4b

Please sign in to comment.