Skip to content

Commit

Permalink
fix default build without -Poss-release
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Apr 26, 2023
1 parent d11c298 commit 8b0bec7
Show file tree
Hide file tree
Showing 23 changed files with 195 additions and 292 deletions.
35 changes: 1 addition & 34 deletions demos/client/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -31,39 +31,6 @@
<artifactId>client</artifactId>
<name>Jakarta Mail API demo client</name>

<build>
<plugins>
<!--
Need to disable the maven-bundle-plugin because the
new version doesn't like classes in the default package.
-->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>osgi-manifest</id>
<phase>none</phase>
</execution>
</executions>
</plugin>

<!--
Because the maven-jar-plugin depends on the manifest file
created by the maven-bundle-plugin, we need to disable it too.
-->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.eclipse.angus</groupId>
Expand Down
34 changes: 17 additions & 17 deletions demos/client/src/main/java/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SimpleClient
example.client.SimpleClient
------------

Notes:
Expand Down Expand Up @@ -27,12 +27,12 @@ To run the demo:

4. Run the demo. For example:

java SimpleClient -L imap://username:password@hostname/
java example.client.SimpleClient -L imap://username:password@hostname/

Note that SimpleClient expects to read the "simple.mailcap"
Note that example.client.SimpleClient expects to read the "simple.mailcap"
file from the current directory. The simple.mailcap file
contains configuration information about viewers needed by
the SimpleClient demo program.
the example.client.SimpleClient demo program.



Expand All @@ -41,26 +41,26 @@ Overview of the Classes

Main Classes:

SimpleClient = contains main().
example.client.SimpleClient = contains main().
Uses the parameters to the application to
locate the correct Store. e.g.

SimpleClient -L imap://cotton:secret@snow-goon/
example.client.SimpleClient -L imap://cotton:secret@snow-goon/

It will create the main frame and
creates a tree. The tree uses the
StoreTreeNodes and FolderTreeNodes.

StoreTreeNode = subclass of Swing's DefaultMutableTreeNode.
example.client.StoreTreeNode = subclass of Swing's DefaultMutableTreeNode.
This class shows how to get Folders from
the Store.

FolderTreeNode = subclass of Swing's DefaultMutableTreeNode.
example.client.FolderTreeNode = subclass of Swing's DefaultMutableTreeNode.
If the folder has messages, it will create
a FolderViewer. Otherwise it will add the
a example.client.FolderViewer. Otherwise it will add the
subfolders to the tree.

SimpleAuthenticator = subclass of jakarta.mail.Authenticator. If
example.client.SimpleAuthenticator = subclass of jakarta.mail.Authenticator. If
the Store is missing the username or the
password, this authenticator will be used.
It displays a dialog requesting the
Expand All @@ -69,22 +69,22 @@ Main Classes:

Viewing Folders:

FolderViewer = Uses a Swing Table to display all of the
example.client.FolderViewer = Uses a Swing Table to display all of the
Message in a Folder. The "model" of the
data for this Table is a FolderModel which
data for this Table is a example.client.FolderModel which
knows how to get displayable information
from a Message.

Jakarta Activation Viewers:

MessageViewer = Uses the content of the DataHandler. The
example.client.MessageViewer = Uses the content of the DataHandler. The
content will be a jakarta.mail.Message
object. Displays the headers and then
uses Jakarta Activation to find another viewer for
the content type of the Message. (either
multipart/mixed, image/gif, or text/plain)

MultipartViewer = Uses the content of the DataHandler. The
example.client.MultipartViewer = Uses the content of the DataHandler. The
content will be a jakarta.mail.Multipart
object. Uses Jakarta Activation to find another
viewer for the first BodyPart's content.
Expand All @@ -93,15 +93,15 @@ Jakarta Activation Viewers:
Button are pressed, it uses Jakarta Activation to
find a viewer for the BodyPart's content,
and displays it in a separate frame (using
ComponentFrame).
example.client.ComponentFrame).

TextViewer = Uses the content of the DataHandler. The
example.client.TextViewer = Uses the content of the DataHandler. The
content will be either a java.lang.String
object, or a java.io.InputStream object.
Creates a TextArea and sets the text using
the String or InputStream.

Support Classes:

ComponentFrame = support class which takes a java.awt.Component
example.client.ComponentFrame = support class which takes a java.awt.Component
and displays it in a Frame.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -8,19 +8,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

import java.awt.*;
import java.awt.event.*;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
package example.client;

import javax.swing.*;
import java.awt.*;

/**
* this Frame provides a utility class for displaying a single
* Component in a Frame.
*
* @author Christopher Cotton
*/

public class ComponentFrame extends JFrame {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -8,17 +8,22 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

import jakarta.mail.*;
package example.client;

import jakarta.mail.Address;
import jakarta.mail.Folder;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;

import javax.swing.table.AbstractTableModel;
import java.util.Date;
import javax.swing.table.AbstractTableModel;

/**
* Maps the messages in a Folder to the Swing's Table Model
*
* @author Christopher Cotton
* @author Bill Shannon
*/

public class FolderModel extends AbstractTableModel {

Folder folder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -8,8 +8,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

package example.client;

import javax.swing.tree.DefaultMutableTreeNode;
import jakarta.mail.Store;

import jakarta.mail.Folder;
import jakarta.mail.MessagingException;

Expand Down Expand Up @@ -81,7 +83,7 @@ protected void loadChildren() {
// Folder[] sub = folder.listSubscribed();
Folder[] sub = folder.list();

// add a FolderTreeNode for each Folder
// add a client.FolderTreeNode for each Folder
int num = sub.length;
for(int i = 0; i < num; i++) {
FolderTreeNode node = new FolderTreeNode(sub[i]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -8,17 +8,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

import java.awt.*;
import jakarta.mail.*;
package example.client;

import jakarta.mail.Folder;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;

import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;

/**
* @author Christopher Cotton
* @author Bill Shannon
*/

public class FolderViewer extends JPanel {

FolderModel model = new FolderModel();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -8,19 +8,29 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

package example.client;

import jakarta.activation.CommandInfo;
import jakarta.activation.CommandObject;
import jakarta.activation.DataHandler;
import jakarta.mail.Address;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.Multipart;
import jakarta.mail.Part;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import jakarta.mail.*;
import jakarta.activation.*;
import java.util.Date;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import javax.swing.JPanel;
import java.util.Date;


/**
* @author Christopher Cotton
* @author Bill Shannon
*/

public class MessageViewer extends JPanel implements CommandObject {

Message displayed = null;
Expand Down Expand Up @@ -184,7 +194,7 @@ public void setCommandContext(String verb,
}
else {
System.out.println(
"MessageViewer - content not a Message object, " + o);
"client.MessageViewer - content not a Message object, " + o);
if (o != null){
System.out.println(o.getClass().toString());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -8,21 +8,26 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.beans.*;
import jakarta.activation.*;
import jakarta.mail.*;
import javax.swing.JPanel;
package example.client;

import jakarta.activation.CommandInfo;
import jakarta.activation.CommandObject;
import jakarta.activation.DataHandler;
import jakarta.mail.BodyPart;
import jakarta.mail.MessagingException;
import jakarta.mail.Multipart;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

/**
* A Viewer Bean for the type multipart/mixed
*
* @author Christopher Cotton
*/

public class MultipartViewer extends JPanel implements CommandObject {

protected DataHandler dh = null;
Expand Down

0 comments on commit 8b0bec7

Please sign in to comment.